smallhomelab / lucene-query-parser
There is no license information available for the latest version (v0.1) of this package.
Basic Lucene Query Parser for Search and Filter
Package info
github.com/smallhomelab/lucene-query-parser
pkg:composer/smallhomelab/lucene-query-parser
v0.1
2018-07-30 05:40 UTC
Requires
- php: ^7.1.3
Requires (Dev)
- phpunit/phpunit: ^6.0
- symfony/var-dumper: ^4.1
This package is not auto-updated.
Last update: 2026-03-15 13:58:37 UTC
README
Lucene query string parser to be used as web api query or filter string. Base code is come from https://github.com/ralphschindler/basic-query-filter
Example queries in this language:
name: appleprice: > 100price: > 100 AND active: = 1product.price: > 100 AND category.id: = 7name:=~ "Foo%"created_at: > "2017-01-01" and created_at: < "2017-01-31"status:= 1 AND (name:= "PHP Rocks" || name:= "I ♥ API's")
Install
composer require "smallhomelab/lucene-query-parser"
Usage
$parseTree = (new LucenenQueryParser\Parser)->parse($filter); // Getting String $str = $parseTree->toString(); // Getting Array $arr = $parseTree->toArray(); // Getting Simple Array $arrSimple = $parseTree->toSimpleArray();