WARNING: Version 5.x 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.
More Like This
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
More Like This
editThe more like this (mlt) API allows to get documents that are "like" a specified document.
Fluent DSL
editvar result = client.MoreLikeThis<ElasticsearchProject>(mlt => mlt
.Id(1)
.MltFields(p => p.Country, p => p.Content)
.MinDocFreq(1)
.Search(s => s
.From(0)
.Size(20)
)
);
Object Initializer Syntax
editvar request = new MoreLikeThisRequest<ElasticsearchProject>(1)
{
MltFields = new PropertyPathMarker[] { "country", "content"},
MinDocFreq = 1,
Search = new SearchRequest
{
From = 0,
Size = 10
}
};
var result = client.MoreLikeThis<ElasticsearchProject>(request);
Handling the MLT response
edit.MoreLikeThis<T> behaves just like .Search<T> in that it also returns an ISearchResponse<T>.
See the {ref_current}/search-more-like-this.html[original docs] for more information.