{"repo":"spatie/elasticsearch-query-builder","free":true,"listed":false,"github":"https://github.com/spatie/elasticsearch-query-builder","clone":"git clone https://github.com/spatie/elasticsearch-query-builder.git","description":"Build and execute an Elasticsearch search query using a fluent PHP API","language":"PHP","stars":182,"topics":["elasticsearch","php"],"license":"MIT","category":"data-pipelines","readme_excerpt":"Build and execute ElasticSearch queries using a fluent PHP API --- This package is a lightweight query builder for ElasticSearch. It was specifically built for our elasticsearch-search-string-parser so it covers most use-cases but might lack certain features. We're always open for PRs if you need anything specific! Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: Note If you're using elasticsearch/elasticsearch v7 you need to use v1 of this package. Basic usage The only class you really need to interact with is the Spatie\\ElasticsearchQueryBuilder\\Builder class. It requires an \\Elastic\\Elasticsearch\\Client passed in the constructor. Take a look at the ElasticSearch SDK docs to learn more about connecting to your ElasticSearch cluster. The Builder class contains some methods to add queries, aggregations, sorts, fields and some extras for pagination. You can read more about these methods below. Once you've fully built-up the query you can use $builder- search() to execute the query or $builder- getPayload() to get the raw payload for ElasticSearch. Multi-Search Queries Multi-Search queries are also available","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/elasticsearch-query-builder/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}