WARNING: Version 1.4 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
The more like this (mlt) API allows to get documents that are "like" a specified document. Here is an example:
$ curl -XGET 'http://localhost:9200/twitter/tweet/1/_mlt?mlt_fields=tag,content&min_doc_freq=1'
The API simply results in executing a search request with
moreLikeThis query (http
parameters match the parameters to the
more_like_this query). This
means that the body of the request can optionally include all the
request body options in the search
API (aggs, from/to and so on). Internally, the more like this
API is equivalent to performing a boolean query of
queries, with one query per specified
Rest parameters relating to search are also allowed, including
mlt_fields are specified, all the fields of the document will
be used in the
more_like_this query generated.
By default, the queried document is excluded from the response (
set to false).
Note: In order to use the
mlt feature a
mlt_field needs to be either
source needs to be enabled.