我的问题是如何使用 NEST (c#) 在渗透函数中使用多匹配、倾斜和模糊等搜索选项?
我想实现一个渗透函数,它返回与以下搜索函数完全相反的结果:
public List<string> search(string query){
.......
.......
var searchResponse = client.Search<Document>(s => s
.AllTypes()
.From(0)
.Take(10)
.Query(q => q // define query
.MultiMatch(mp => mp // of type MultiMatch
.Query(input.Trim())
.Fields(f => f // define fields to search against
.Fields(f3 => f3.doc_text))
.Slop(2)
.Operator(Operator.And)
.Fuzziness(Fuzziness.Auto))));
}
以下是我目前使用的渗透函数,但不知道如何包含多匹配、倾斜和模糊选项。我在其文档中找不到有关此的详细信息。
var searchResponseDoc = client.Search<PercolatedQuery>(s => s
.Query(q => q
.Percolate(f => f
.Field(p => p.Query)
.DocumentType<Document>() //I have a class called Document
.Document(myDocument))) // myDocument is an object of type Document
谢谢。