myappin / elasticsearchpredicate
ElasticSearch nested predicate generator
Installs: 4 481
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=8.1
- ext-curl: *
- ezimuel/ringphp: 1.2.0
- myappin/elasticsearch-php: dev-master#d032d36333f1c66b27b60601529512448cbdc920
- myappin/knapsack: dev-master#e42820bbfe3315aeeec32a164882c5aba32b93b1
- psr/log: ~1.0
Requires (Dev)
- phpunit/phpunit: 9.5.6
- dev-master
- 5.6.17
- 5.6.16
- 5.6.15
- 5.6.14
- 5.6.13
- 5.6.12
- 5.6.11
- 5.6.10
- 5.6.9
- 5.6.8
- 5.6.7
- 5.6.6
- 5.6.5
- 5.6.4
- 5.6.3
- 5.6.2
- 5.6.1
- 4.1.0
- 4.0.1
- 4.0.0
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- dev-development
This package is auto-updated.
Last update: 2025-01-26 12:57:20 UTC
README
ElasticSearchPredicate
is simple PHP API for ElasticSearch. It simulates Zend-Db predicates.
Please create issue while missing something or finding a bug
Install
composer: HERE OR
git clone https://github.com/myappin/ElasticSearchPredicate.git
Usage
Adding predicates
addPredicate(PredicateInterface $predicate)
, andPredicate(PredicateInterface $predicate)
, orPredicate(PredicateInterface $predicate)
, and(PredicateInterface $predicate)
, or(PredicateInterface $predicate)
Basic predicates
$_client = new Client(); $_search = $_client->search(); $_search->limit(10)->order('_uid', 'asc')->predicate->Term('name', 'SomeName')->or->Term('price', 1000);
Nesting
$_client = new Client(); $_search = $_client->search(); $_search->limit(10)->order('_uid', 'asc')->predicate->nest()->Term('name', 'SomeName')->or->Term('name', 'SomeOtherName')->unnest()->Term('price', 1000);
Boosting
$_client = new Client(); $_search = $_client->search(); $_search->limit(10)->order('_uid', 'asc')->predicate->andPredicate((new Term('name', 'SomeName'))->boost(2))->or->Term('name', 'SomeOtherName'); //or $_search->limit(10)->order('_uid', 'asc')->predicate->Term('name', 'SomeName', ['boost' => 2])->or->Term('name', 'SomeOtherName');
Nested objects, Ranges, Score Functions and more and more