pmishev / elasticsearch-dsl-php
Elasticsearch DSL library
v8.0.0
2025-04-24 12:31 UTC
Requires
- php: ^8.1
- symfony/serializer: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.74
- php-coveralls/php-coveralls: ^2.7.0
- phpunit/phpunit: ^10.0
- rector/rector: ^2.0
- dev-main
- 8.0.x-dev
- v8.0.0
- 6.x-dev
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v6.0.0-beta
- 5.x-dev
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- 5.0.0
- 2.x-dev
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-alpha
- 1.x-dev
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v1.0.0-RC1
- dev-7.2-daterangeaggregation-fix
- dev-7.1-daterangeaggregation-fix
- dev-6.1-daterangeaggregation-fix
- dev-6.2-daterangeaggregation-fix
- dev-2020-07-01-daterangeaggregation-fix
- dev-2019-06-27-daterangeaggregation
This package is auto-updated.
Last update: 2025-04-24 12:44:22 UTC
README
Elasticsearch DSL library to provide objective query builder for the elasticsearch-php client. You can easily build any Elasticsearch query and transform it to an array.
This is a fork of the abandoned https://github.com/ongr-io/ElasticsearchDSL
Version matrix
Elasticsearch version | Bundle version |
---|---|
>= 8.0 | >= 8.0 |
>= 7.0 | >= 7.0 |
>= 6.0, < 7.0 | >= 6.0 |
>= 5.0, < 6.0 | >= 5.0 |
Documentation
The online documentation of the bundle is here
Try it!
Installation
$ composer require pmishev/elasticsearch-dsl-php ^8.0
Example usage
<?php require 'vendor/autoload.php'; // Composer autoload use Elasticsearch\ClientBuilder; use ONGR\ElasticsearchDSL\Query\MatchAllQuery; use ONGR\ElasticsearchDSL\Search; // Build an elasticsearch-php client $clientBuilder = ClientBuilder::create(); $clientBuilder->setHosts(['localhost:9200']); $client = $clientBuilder->build(); $search = (new Search())->addQuery(new MatchAllQuery()); $params = [ 'index' => 'your_index', 'body' => $search->toArray(), ]; $results = $client->search($params);