[英]ElasticSearch filter query for having null value
I want to filter data from elasic search document like documents which is having blank list.我想从 elasic 搜索文档中过滤数据,例如具有空白列表的文档。 HOw can i achieve that.
我怎么能做到这一点。 Suppose i want this results.
假设我想要这个结果。
1) { name:'vipul', gender:[] } 1) { 姓名:'vipul', 性别:[] }
this is having blank list这是有空白列表
You can combine a bool
query with a exists
query like so:您可以将
bool
查询与exists
查询组合,如下所示:
"bool": {
"must_not": [
{
"exists": {
"field": "gender"
}
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.