Skip to content
Snippets Groups Projects
Commit 9a0473cd authored by Simonas Šerlinskas's avatar Simonas Šerlinskas
Browse files

added common terms docs

parent d4fea5d3
No related branches found
No related tags found
No related merge requests found
# Common terms query
> More info about Common terms query is in the [official elasticsearch docs][1]
There are so many use cases with `Common Terms` query. We highly recommend to take a look at the [official docs][1] before continuing.
Lets take first example to write easy `Common query` with Elasticsearch DSL.
```JSON
{
"common": {
"name": {
"query": "this is bonsai cool",
"cutoff_frequency": 0.001,
"minimum_should_match": {
"low_freq" : 2,
"high_freq" : 3
}
}
}
}
```
And now the query via DSL:
```php
$commonTermsQuery = new CommonTermsQuery(
"field_name",
"this is bonsai cool",
[
"cutoff_frequency" => 0.001,
"minimum_should_match" => [
"low_freq" => 2,
"high_freq" => 3,
],
]
);
$search = new Search();
$search->addQuery($commonTermsQuery);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.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