Skip to content
Snippets Groups Projects
Commit 7094705a authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Add exists filter doc.

parent 136ff817
No related branches found
No related tags found
No related merge requests found
# Exists Filter
> More info about exists filter is in the [official elasticsearch docs][1]
Returns documents that have at least one non-null value in the original field.
## Simple example
```JSON
{
"constant_score" : {
"filter" : {
"exists" : { "field" : "user" }
}
}
}
```
And now the query via DSL:
```php
$existsFilter = new ExistsFilter('user');
$constantScoreQuery = new ConstantScoreQuery($existsFilter);
$search = new Search();
$search->addQuery($constantScoreQuery);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-filter.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment