在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和值的问题,不涉及其他云计算品牌商。
Elastic 中国开发者大会
Elastic 实战工作坊
Elastic 实战工作坊
Elastic Meetup
云+社区技术沙龙[第17期]
腾讯云GAME-TECH游戏开发者技术沙龙
Elastic 实战工作坊
云+社区技术沙龙[第26期]
腾讯云“智能+互联网TechDay”华北专场
云+社区技术沙龙[第21期]
领取专属 10元无门槛券
手把手带您无忧上云