在elasticsearch中搜索null和值(但不是non exists)可以通过使用exists查询和missing查询来实现。
GET /index/_search
{
"query": {
"exists": {
"field": "fieldName"
}
}
}
其中,index
是要搜索的索引名称,fieldName
是要搜索的字段名称。
GET /index/_search
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "fieldName"
}
}
}
}
}
其中,index
是要搜索的索引名称,fieldName
是要搜索的字段名称。
应用场景:
推荐的腾讯云相关产品:
请注意,本答案仅针对elasticsearch中搜索null和值的问题,不涉及其他云计算品牌商。
领取专属 10元无门槛券
手把手带您无忧上云