1
下面的Sense查詢返回我正在查找的結果,但是當我將其轉換爲NEST查詢時,我總是收到0個結果。我哪裏錯了?無法將ElasticSearch多索引查詢轉換爲NEST查詢
GET /event,meeting,executive,list,call/_search
{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"match": {
"name": "sample query"
}
},
{
"match": {
"agenda": "sample query"
}
}
]
}
},
"filter": {
"query": {
"match": {
"symbol": "SAMPLESYMBOL"
}
}
}
}
}
}
這裏是我使用的NEST搜索描述符,總是返回0個結果。
return arg.Indices(new[] { "event", "meeting", "executive", "list", "call" })
.Size(size)
.Filter(f => f.Query(qu => qu.Match(m => m.OnField("symbol").Query("SAMPLESYMBOL"))))
.Query(q => q
.Bool(b => b
.Should(
s => s.Match(m => m.Query(query).OnField("name")),
s => s.Match(m => m.Query(query).OnField("agenda")))));