elasticsearch - 在对象数组中查找具有至少一个空值的文档
问题描述
我们的数据结构如下
{
"foo": "bar",
"baz": [
{
"qux": true
},
{
"qux": null
},
{
"qux": false
}
]
}
在其他文档中,baz
数组中的项目数可能会有所不同。
我们正在寻找在数组中至少具有一个null
值的文档。qux
baz
我们尝试过:
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "baz.qux"
}
}
}
}
}
但是,这不会返回在数组中具有例如一个true
和一个null
值的文档。qux
baz
任何帮助将不胜感激!
解决方案
推荐阅读
- ruby-on-rails - Why does strong params order in Rails matter?
- ios - AirPlay 接收器文档
- r - 使用 RWeka 时尝试将 Rmd 文件编织到 Word 的问题
- scalability - Design of HA, consistent and responsive counter
- python - python - 比较两个csv文件并生成报告
- javascript - 如何在android应用程序的webview中动态更改应用于网页的样式(css)
- angular4-forms - 角度 4 - 选择选项更改
- python - Django Rest Framework - 'type' 类型的对象不是 json 可序列化错误
- python - 带有分页的 PyMongo 中光标过大的 MemoryError
- java - MySQLNonTransientConnectionException 错误并要求升级 MySQL 客户端