see on GitHub

Commands: Querying: How to work with MoreLikeThis query?

To find similar or related documents use the MoreLikeThis method from commands.

Syntax

public MultiLoadResult moreLikeThis(MoreLikeThisQuery query);

Parameters
query MoreLikeThisQuery A more like this query definition that will be executed
Return Value
MultiLoadResult Instance of MultiLoadResult containing query Results and Includes (if any).

Example I

// Search for similar documents to 'articles/1'
// using 'Articles/MoreLikeThis' index and search only field 'Body'
MoreLikeThisQuery moreLikeThisQuery = new MoreLikeThisQuery();
moreLikeThisQuery.setIndexName("Articles/MoreLikeThis");
moreLikeThisQuery.setDocumentId("articles/1");
moreLikeThisQuery.setFields(new String[] { "Body" });
MultiLoadResult result = store.getDatabaseCommands().moreLikeThis(moreLikeThisQuery);

Example II

// Search for similar documents to 'articles/1'
// using 'Articles/MoreLikeThis' index and search only field 'Body'
// where article category is 'IT'
MoreLikeThisQuery moreLikeThisQuery = new MoreLikeThisQuery();
moreLikeThisQuery.setIndexName("Articles/MoreLikeThis");
moreLikeThisQuery.setDocumentId("articles/1");
moreLikeThisQuery.setFields(new String[] { "Body" });
moreLikeThisQuery.setAdditionalQuery("Category:IT");
MultiLoadResult result = store.getDatabaseCommands().moreLikeThis(moreLikeThisQuery);