PHPackages                             keboola/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. keboola/elasticsearch-dsl

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

keboola/elasticsearch-dsl
=========================

Elasticsearch DSL library

v6.01.0(3y ago)010.1kMITPHPPHP ^8

Since Apr 17Pushed 3y agoCompare

[ Source](https://github.com/keboola/ElasticsearchDSL)[ Packagist](https://packagist.org/packages/keboola/elasticsearch-dsl)[ Docs](http://ongr.io)[ RSS](/packages/keboola-elasticsearch-dsl/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (18)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 preffered and recommended way to ask ONGR support questions.

[![Build Status](https://camo.githubusercontent.com/4a0600513ab366a1a36493b8b20aa07d7d1b3091d87b0b2f565b729163f38594/68747470733a2f2f7472617669732d63692e6f72672f6f6e67722d696f2f456c617374696373656172636844534c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ongr-io/ElasticsearchDSL)[![Coverage Status](https://camo.githubusercontent.com/58eb097da84222fb99bab23d7448a64cf8ed3f3ac78b8ba177f5547b59b2f0e6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6f6e67722d696f2f456c617374696373656172636844534c2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/ongr-io/ElasticsearchDSL?branch=master)[![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)

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

[](#version-matrix)

Elasticsearch versionElasticsearchDSL version&gt;= 5.0&gt;= 5.0&gt;= 2.0, &lt; 5.0&gt;= 2.0, &lt; 5.0&gt;= 1.0, &lt; 2.01.x&lt;= 0.90.x0.xDocumentation
-------------

[](#documentation)

The latest library online documentation of the bundle [is here](http://docs.ongr.io/ElasticsearchDSL). If you need 2.x docs you can find it in [the github branch here](https://github.com/ongr-io/ElasticsearchDSL/tree/2.x/docs).

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:

```
