我正在尝试运行一个定义如下的elasticsearch查询:
query = {
"query": {
"bool": {
"should": [
{"term": {"a": "a1"}},
{"term": {"b": "b1"}},
{"term": {"c": "c1"}}
],
},
},
}
es.search("my_index", body=q1)但我得到以下错误:
RequestError: TransportError(400, 'search_phase_execution_exception',
'failed to create query:
...查询有什么问题?
发布于 2017-04-25 12:41:33
试试这个:-
{
"query": {
"bool": {
"should": [
{"term": {"a": "a1"}},
{"term": {"b": "b1"}},
{"term": {"c": "c1"}}
]
}
}
}发布于 2017-04-25 00:18:32
它可能无法解析JSON,因为您的数组中有一个尾随逗号。(在每个查询和bool属性之后还有几个) JSON规范不允许多余的尾随逗号。
https://stackoverflow.com/questions/43592999
复制相似问题