Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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