Can someone give me an Example for using PlainElastic.Net.Queries.MoreLikeThisQuery class? the documentation doesn't contain examples for using QueryBase classes.
Asked
Active
Viewed 654 times
2 Answers
0
I figured out how to do it:
var connection = new ElasticConnection("localhost", 9200);
string command = new SearchCommand("index", "type");
SearchCommand searchCommand = new SearchCommand();
searchCommand.Analyzer("arabic");
QueryBuilder<MyType> builder = new QueryBuilder<MyType>();
builder.Query (q => q.MoreLikeThis(t=> t.LikText ("Text to search for")
.Analyzer("analyzer_name")));
string queryText = builder.Build();
string result = connection.Get(command, queryText);

Muhammad Soliman
- 529
- 5
- 17
0
I contacted Alexander Yegorov, and he added two examples for mlt queries:
https://gist.github.com/Yegoroff/5572590 https://gist.github.com/Yegoroff/5572496
Thanks very much for him.

Muhammad Soliman
- 529
- 5
- 17