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

Add script filter doc.

parent c4003c67
No related branches found
No related tags found
No related merge requests found
# Script Filter
> More info about script filter is in the [official elasticsearch docs][1]
A filter allowing to define scripts as filters
## Simple example
```JSON
{
"filter" : {
"script" : {
"script" : "doc['num1'].value > 1"
}
}
}
```
And now the query via DSL:
```php
$scriptFilter = new ScriptFilter('doc[\'num1\'].value > 1');
$search = new Search();
$search->addFilter($scriptFilter);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-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