Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Bodybuilder | 1,218 | 105 | 58 | a month ago | 65 | May 21, 2022 | 9 | mit | JavaScript | |
An elasticsearch query body builder :muscle: | ||||||||||
Elastic Builder | 460 | 16 | 16 | 16 days ago | 58 | June 05, 2021 | 16 | mit | JavaScript | |
A Node.js implementation of the elasticsearch Query DSL :construction_worker: | ||||||||||
Esquery | 222 | a year ago | 7 | apache-2.0 | Go | |||||
An idiomatic Go query builder for ElasticSearch | ||||||||||
Elasticshell | 106 | 8 years ago | 13 | apache-2.0 | Java | |||||
A javascript shell for elasticsearch | ||||||||||
Elasticquery | 78 | 2 years ago | 53 | December 15, 2021 | 3 | mit | Python | |||
A simple (Python) query builder for Elasticsearch | ||||||||||
Wpes Lib | 67 | 3 years ago | gpl-2.0 | PHP | ||||||
WordPress-Elasticsearch Lib | ||||||||||
Q Builders | 48 | 4 | 2 | 2 years ago | 7 | June 23, 2017 | 2 | mit | Java | |
Type safe database agnostic query builders. | ||||||||||
Fast Elasticsearch Query Builder | 47 | 4 years ago | apache-2.0 | Java | ||||||
A fast way to build ElasticSearch query string, even without writing implement code. | ||||||||||
Spring Data Elasticsearch | 47 | 7 years ago | 2 | HTML | ||||||
:cn:Spring-Data-Elasticsearch官方文档的中文翻译版本,翻译不好请见谅,欢迎提issue | ||||||||||
Elasticsearch Query Builder | 37 | a month ago | 2 | mit | PHP | |||||
Build query for an ElasticSearch client using a fluent interface |
The olvlvl/elasticsearch-dsl
package provides an objective query builder for Elasticsearch. It
helps you create Elasticsearch queries using
the same language as you would use writing arrays by hand.
I created this library because I found using ongr-io/ElasticsearchDSL, the only other available option, very cumbersome, and I wanted an interface that would feel more natural regarding Elasticsearch language.
I've been working on this library since January, it's far from being feature complete, but I'm getting there :) If you'd like to help please submit a PR.
Here is a simple example, take from Elasticsearch documentation. More are available in our documentation.
{
"query": {
"bool": {
"must": [
{ "match": { "title": "Search" } },
{ "match": { "content": "Elasticsearch" } }
],
"filter": [
{ "term": { "status": "published" } },
{ "range": { "publish_date": { "gte": "2015-01-01" } } }
]
}
}
}
<?php
use olvlvl\ElasticsearchDSL\Query;
$query = new Query;
$query->bool->must
->match('title', "Search")
->match('content', "Elasticsearch");
$query->bool->filter
->term('status', 'published')
->range('publish_date', function (Query\Term\RangeQuery $range) {
$range->gte("2015-01-01");
});
The package requires PHP 7.1 or later.
The recommended way to install this package is through Composer:
$ composer require olvlvl/elasticsearch-dsl
The package is available on GitHub, its repository can be cloned with the following command line:
$ git clone https://github.com/olvlvl/elasticsearch-dsl.git
You can generate the documentation for the package and its dependencies with the make doc
command.
The documentation is generated in the build/docs
directory. ApiGen is
required. The directory can later be cleaned with the make clean
command.
The test suite is ran with the make test
command. PHPUnit and
Composer need to be globally available to run the suite. The command
installs dependencies as required. The make test-coverage
command runs test suite and also creates
an HTML coverage report in build/coverage
. The directory can later be cleaned with the
make clean
command.
The package is continuously tested by Travis CI.
olvlvl/elasticsearch-dsl is licensed under the New BSD License - See the LICENSE file for details.