大佬教程收集整理的这篇文章主要介绍了Elasticsearch 2.4,对嵌套对象不起作用存在过滤器,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我找到了正确的语法,应该是:
GET /index/type/_search
{
"query": {
"bool": {
"must_not": [
{
"nested": {
"path": "user",
"query": {
"exists": {
"fIEld": "user"
}
}
}
}
]
}
}
}
我的映射是:
"properties": {
"user": {
"type": "nested","properties": {
"id": {
"type": "Integer"
},"is_active": {
"type": "Boolean","null_value": false
},"username": {
"type": "String"
}
}
},
我想获取所有没有user
字段的文档。
我试过了:
GET /index/type/_search
{
"query": {
"bool": {
"must_not": [
{
"exists": {
"field": "user"
}
}
]
}
}
}
返回所有文档。基于ElasticSearch2.x,存在用于嵌套字段的过滤器不起作用的问题,我也尝试过:
GET /index/type/_search
{
"query": {
"nested": {
"path": "user","query": {
"bool": {
"must_not": [
{
"exists": {
"field": "user"
}
}
]
}
}
}
}
}
返回0个文档。
使所有缺少该user
字段的文档的正确查询是什么?
以上是大佬教程为你收集整理的Elasticsearch 2.4,对嵌套对象不起作用存在过滤器全部内容,希望文章能够帮你解决Elasticsearch 2.4,对嵌套对象不起作用存在过滤器所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。