在elasticsearch 5.6.2和5.6.3(Ubuntu 16.04)中,这个查询
GET _search
{
"simple_query_string": {
"query": "test1 + test2",
"analyzer": "snowball",
"fields": ["myfield"],
"default_operator": "and"
}
}
导致此错误
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [simple_query_string].",
"line": 2,
"col": 44
}
],
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [simple_query_string].",
"line": 2,
"col": 44
},
"status": 400
}
几乎相同
有人能帮助我吗?
答案 0 :(得分:4)
您需要在simple_query_string
部分中加入query
,如下所示:
GET _search
{
"query": {
"simple_query_string": {
"query": "test1 + test2",
"analyzer": "snowball",
"fields": ["myfield"],
"default_operator": "and"
}
}
}