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
非常感謝他。