More Like Thisedit

The more like this (mlt) API allows to get documents that are "like" a specified document.

Fluent DSLedit

var 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 Syntaxedit

var 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 responseedit

.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.