Skip to the content.

Query Types

Elasticsearch PHP Client provides a fluent API for building Elasticsearch queries. This section covers different types of queries supported by the library.

Available Query Types

Query Builder Pattern

All query types follow a consistent builder pattern, making them easy to use and combine.

<?php
use Zvonchuk\Elastic\Query\QueryBuilders;

// Creating a query is as simple as using the appropriate factory method
$query = QueryBuilders::matchQuery('title', 'elasticsearch');

// Many query types support additional options
$query->operator('AND')->fuzziness('AUTO');

Browse the sections to learn more about each query type.