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

Add more like this query doc.

parent 7a2c8de4
No related branches found
No related tags found
No related merge requests found
# More Like This Query
> More info about more like this query is in the [official elasticsearch docs][1]
The More Like This Query (MLT Query) finds documents that are "like" a given set of documents.
## Simple example
```JSON
{
"more_like_this" : {
"fields" : ["title", "description"],
"like_text" : "Once upon a time",
"min_term_freq" : 1,
"max_query_terms" : 12
}
}
```
In DSL:
```php
$moreLikeThisQuery = new MoreLikeThisQuery(
'Once upon a time',
[
'fields' => ['title', 'description'],
'min_term_freq' => 1,
'max_query_terms' => 12,
]
);
$search = new Search();
$search->addQuery($moreLikeThisQuery);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-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