Lukas

A PHP Search Query Parser

  • 所有者: OnroerendErfgoed/Lukas
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Lukas - Search Query Handler

Lukas is a library that helps in implementing a custom search query language.
It offers some standard features users have come to expect from text driven search
like boolean operators and subexpressions.

Lukas can also help you implement custom behaviour for certain keywords, you
might for eg. define that keyword "photo" to mean "search for things that have a
photo".

Unit Tests

Build Status

Query Syntax

The Lukas query parser supports a fairly universal search query standard. It is
meant to support the most common search combinations while be fairly simple to
use by non-technical users.

It supports the following features:

  • Keywords are split on whitespace, eg. Lukas me contains two keywords.
  • Keywords can be grouped using quotation marks, eg. "Lukas me" only contains
    one keyword.
  • Keywords can be combined using boolean and, eg. Lukas AND me. This is also
    the default combination, so Lukas me is the same as Lukas AND me.
  • Keywords can be combined using boolean or, eg. Lukas OR me.
  • Keywords can be negated using boolean, written as -keyword, eg. -Lukas.
  • Combinational logic can be specified using parentheses, eg. Lukas OR (me AND you).
  • A keyword can be explicitely marked as belonging to a certain domain,
    eg. people:Lukas.

Installation

Lukas can be installed from packagist through
composer. Add a file called composer.json
that contains the following:

{
	"require": {
		"oe/lukas": "dev-master"
	}
}

Please bear in mind that Lukas is still in active development. Installing
"dev-master" means you are running from trunk. As soon as we hit a stable version
it would be best to change "dev-master" to eg. "0.1.0"

Download and install composer:

curl -s http://getcomposer.org/installer, php

Install Lukas:

php composer.phar install

Examples

The examples folder contains some samples of what can be parsed and how a certain
string will be parsed.

Contributing

All contributions are welcome. Please fork the repository and send us a pull
request. If at all possible include unit tests in the pull request.

To run the unit tests, first download and install composer:

curl -s http://getcomposer.org/installer, php

Create the autoloader:

php composer.phar install

Run the unit tests:

phpunit

Out of the box this will print code coverage information to the commandline.
Although this is usefull and tells us how much coverage each class has, it does
not show what parts of a class are covered or not. To see that kind of information,
please run phpunit like this:

phpunit --coverage-html build/coverage/html

主要指標

概覽
名稱與所有者OnroerendErfgoed/Lukas
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2012-08-07 14:28:28
推送於2015-11-26 15:58:09
最后一次提交2012-08-14 23:27:21
發布數0
用户参与
星數25
關注者數10
派生數7
提交數19
已啟用問題?
問題數8
打開的問題數6
拉請求數0
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?