myappin/elasticsearchpredicate
最新稳定版本:8.0.2
Composer 安装命令:
composer require myappin/elasticsearchpredicate
包简介
ElasticSearch nested predicate generator
README 文档
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
统计信息
- 总下载量: 5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-05-25