PHPackages                             tandrezone/elasticsearch-dsl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. tandrezone/elasticsearch-dsl

ActiveLibrary[Search &amp; Filtering](/categories/search)

tandrezone/elasticsearch-dsl
============================

Elasticsearch DSL library

03PHP

Since Jun 19Pushed 2y agoCompare

[ Source](https://github.com/tandrezone/ElasticsearchDSL)[ Packagist](https://packagist.org/packages/tandrezone/elasticsearch-dsl)[ RSS](/packages/tandrezone-elasticsearch-dsl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ElasticsearchDSL
================

[](#elasticsearchdsl)

Introducing Elasticsearch DSL library to provide objective query builder for [Elasticsearch bundle](https://github.com/ongr-io/ElasticsearchBundle) and [elasticsearch-php](https://github.com/elastic/elasticsearch-php) client. You can easily build any Elasticsearch query and transform it to an array.

If you need any help, [stack overflow](http://stackoverflow.com/questions/tagged/ongr)is the preferred and recommended way to ask ONGR support questions.

[![Build Status](https://camo.githubusercontent.com/4a0600513ab366a1a36493b8b20aa07d7d1b3091d87b0b2f565b729163f38594/68747470733a2f2f7472617669732d63692e6f72672f6f6e67722d696f2f456c617374696373656172636844534c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ongr-io/ElasticsearchDSL)[![codecov](https://camo.githubusercontent.com/0d688a6024a337f1fd3f3b4de243a5d11c1826d1fd861d02ec734a9483369ff7/68747470733a2f2f636f6465636f762e696f2f67682f6f6e67722d696f2f456c617374696373656172636844534c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ongr-io/ElasticsearchDSL)[![Latest Stable Version](https://camo.githubusercontent.com/ddb409c098077dc171ded4c98fd4106914892c280e05b6414e9eddee7009072c/68747470733a2f2f706f7365722e707567782e6f72672f6f6e67722f656c61737469637365617263682d64736c2f762f737461626c65)](https://packagist.org/packages/ongr/elasticsearch-dsl)[![Total Downloads](https://camo.githubusercontent.com/9e7631038dc3470898b1ea0bd4f3628a34abebdcca67a6d2cfb932f30d89cc56/68747470733a2f2f706f7365722e707567782e6f72672f6f6e67722f656c61737469637365617263682d64736c2f646f776e6c6f616473)](https://packagist.org/packages/ongr/elasticsearch-dsl)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/35270b2957d94da51bebec909804ee9b8904db213d9b7b8da9dc8a1d525c21c0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f6e67722d696f2f456c617374696373656172636844534c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchDSL/?branch=master)

If you like this library, help me to develop it by buying a cup of coffee

[![Buy Me A Coffee](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/zIKBXRc)

Version matrix
--------------

[](#version-matrix)

Elasticsearch versionElasticsearchDSL version&gt;= 7.0&gt;= 7.0&gt;= 6.0, &lt; 7.0&gt;= 6.0&gt;= 5.0, &lt; 6.0&gt;= 5.0&gt;= 2.0, &lt; 5.0&gt;= 2.0 (not supported)&gt;= 1.0, &lt; 2.01.x (not supported)&lt;= 0.90.xnot supportedDocumentation
-------------

[](#documentation)

[The online documentation of the bundle is here](docs/index.md)

Try it!
-------

[](#try-it)

### Installation

[](#installation)

Install library with [composer](https://getcomposer.org):

```
$ composer require ongr/elasticsearch-dsl
```

> [elasticsearch-php](https://github.com/elastic/elasticsearch-php) client is defined in the composer requirements, no need to install it.

### Search

[](#search)

Elasticsearch DSL was extracted from [Elasticsearch Bundle](https://github.com/ongr-io/ElasticsearchBundle) to provide standalone query dsl for [elasticsearch-php](https://github.com/elastic/elasticsearch-php). Examples how to use it together with [Elasticsearch Bundle](https://github.com/ongr-io/ElasticsearchBundle) can be found in the [Elasticsearch Bundle docs](https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/search.md).

If you dont want to use Symfony or Elasticsearch bundle, no worries, you can use it in any project together with [elasticsearch-php](https://github.com/elastic/elasticsearch-php). Here's the example:

If you are using Symfony there is also the [ElasticsearchBundle](https://github.com/ongr-io/ElasticsearchBundle)which provides full integration with Elasticsearch DSL.

The library is standalone and is not coupled with any framework. You can use it in any PHP project, the only requirement is composer. Here's the example:

Create search:

```
