diff --git a/docs/Filter/index.md b/docs/Filter/index.md new file mode 100644 index 0000000000000000000000000000000000000000..284c08950fb45751542bbb087f509abece950e56 --- /dev/null +++ b/docs/Filter/index.md @@ -0,0 +1,63 @@ +# Query + +Objective filter builder represents all available [Elasticsearch filters][1]. + +To form a filtered query you have to create `Search` object. See below an example of match all filter usage. + +```php +$search = new Search(); +$matchAllFilter = new MatchAllFilter(); +$search->addFilter($matchAllFilter); +$queryArray = $search->toArray(); +``` + +Filters handles are necessary little things like where to put `\stdClass` and where to simple array. So by using DSL builder you can be always sure that it will form a correct query. + +Here's `$queryArray` var_dump: + +```php +//$queryArray content +'query' => [ + 'filtered' => [ + 'filter' => [ + 'match_all' => \stdClass(), + ] + ] + ] +``` + +For more information how to combine search queries take a look at [How to search](../HowTo/HowToSearch.md) chapter. + + +## Filters: + - [And](And.md) + - [Bool](Bool.md) + - [Exists](Exists.md) + - [GeoBoundingBox](GeoBoundingBox.md) + - [GeoDistance](GeoDistance.md) + - [GeoDistanceRange](GeoDistanceRange.md) + - [GeoPolygon](GeoPolygon.md) + - [GeoShape](GeoShape.md) + - [GeohashCell](GeohashCell.md) + - [HasChild](HasChild.md) + - [HasParent](HasParent.md) + - [Ids](Ids.md) + - [Indices](Indices.md) + - [Limit](Limit.md) + - [MatchAll](MatchAll.md) + - [Missing](Missing.md) + - [Nested](Nested.md) + - [Not](Not.md) + - [Or](Or.md) + - [Post](Post.md) + - [Prefix](Prefix.md) + - [Query](Query.md) + - [Range](Range.md) + - [Regexp](Regexp.md) + - [Script](Script.md) + - [Term](Term.md) + - [Terms](Terms.md) + - [Type](Type.md) + + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filters.html diff --git a/docs/index.md b/docs/index.md index 0f73b6efc01bd6ae67ce84b5ccd7a094c0a09951..81b825606e547629520e44e7cf8029109ba7b71b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ Everything starts from the `Search` object. We recommend first to take a look at ### Topics: - [Build Queries](Query/index.md) -- [Build Filters] +- [Build Filters](Filter/index.md) - [Build Aggregations] ### How to