0
有人可以给我一个使用PlainElastic.Net.Queries.MoreLikeThisQuery类的例子吗?该文档不包含使用QueryBase类的示例。MoreLikeThisQuery查询PlainElastic.net
有人可以给我一个使用PlainElastic.Net.Queries.MoreLikeThisQuery类的例子吗?该文档不包含使用QueryBase类的示例。MoreLikeThisQuery查询PlainElastic.net
我想出如何做到这一点:
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);
我联系亚历山大·叶戈罗夫,他增加了MLT查询两个例子:
https://gist.github.com/Yegoroff/5572590 https://gist.github.com/Yegoroff/5572496
非常感谢他。