有人知道如何解决以下查询吗?
400:{“错误”:{“ root_cause”:[{“ type”:“ parsing_exception”,“ reason”:“ [someField1]查询格式不正确,查询名称后没有start_object”,“ line”:6,” col“:22}],” type“:” parsing_exception“,” reason“:” [someField1]查询格式错误,查询名称后没有start_object“,” line“:6,” col“:22},”状态“: 400}
{
"query": {
"bool": {
"must": [
{
"someField1": true
}
],
"must_not": [
{
"exists": {
"field": "someField2"
}
}
]
}
}
}
答案 0 :(得分:3)
您缺少对testField1
的查询,它应该是term
或match
:
{
"query": {
"bool": {
"must": [
{
"term": { <--- add this
"someField1": true
}
}
],
"must_not": [
{
"exists": {
"field": "someField2"
}
}
]
}
}
}