我有一个搜索,它给出了正确的结果并试图让它在 .NET Nest 中工作,但我似乎无法获得正确的语法。这是我拥有的 elastricsearch 查询:
{
"query": {
"filtered": {
"query": {
"match": { "formattedName": "Michael" }
},
"filter": {
"bool": {
"must": [
{ "term": { "projectId": "5022" } },
{ "term": { "isInvalid": "false" } }
]
}
}
}
}
}
在我的解决方案中,我有以下内容:
var lst = client.Search<EntitySearchItem>(s => s
.Size(recordCount)
.Index("entitysearch")
.Filter(f => f
.Bool(b => b
.Must(m => m.Term("projectId", projectId),
m => m.Term("isInvalid", "false"))))
.Query(q => q
.Match(p => p.OnField(f => f.FormattedName).Query(name))));
有谁熟悉 Nest 知道我怎样才能得到相同的结果?谢谢!