3 回答

TA貢獻1858條經(jīng)驗 獲得超8個贊
好的,我不會深入研究您的語言查詢 API。由于您要搜索不存在的字段(空),請exists在 a 內(nèi)使用過濾器must_not(如果您使用 bool 過濾器):
{
"query": {
"filtered": {
"filter": {
"bool": {
"must_not": [
{
"exists": {
"field": "your_field"
}
}
]
}
}
}
},
"from": 0,
"size": 500
}
希望這可以幫助!

TA貢獻1827條經(jīng)驗 獲得超8個贊
您可以使用帶有bool 查詢 must_not 的存在查詢:
GET /_search
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "your_field"
}
}
}
}
}
在 Elasticsearch 6.5 中測試

TA貢獻1820條經(jīng)驗 獲得超9個贊
您可以為不存在創(chuàng)建一個布爾查詢,如下所示:
existsQuery := elastic.NewExistsQuery(fieldName)
existsBoolQuery := elastic.NewBoolQuery().MustNot(existsQuery)
- 3 回答
- 0 關(guān)注
- 235 瀏覽
添加回答
舉報