0
我在ES索引中創建了一個文檔。我需要運行搜索查詢。彈性搜索查詢的未知令牌錯誤
這是我的搜索載荷。
{
"highlight": {
"require_field_match": true,
"pre_tags": [
"<span class=\"searchKeyHighlight\">"
],
"post_tags": [
"</span>"
],
"fields": {}
},
"query": {
"query_string": {
"multi_match": {
"default_operator": "AND",
"query": "xyz"
}
}
}
}
這是我得到的錯誤。
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[query_string] unknown token [START_OBJECT] after [multi_match]",
"line": 1,
"col": 170
}
],
"type": "parsing_exception",
"reason": "[query_string] unknown token [START_OBJECT] after [multi_match]",
"line": 1,
"col": 170
},
"status": 400
}
山口170是在搜索查詢"multi_match":{"default_operator"
multi_match後結腸。
我正在使用elasticsearch版本5.0.0。
Version: 5.0.0, Build: 253032b/2016-10-26T04:37:51.531Z, JVM: 1.8.0_102
我不明白什麼是錯的multi_match查詢。
您可以有一個['multi_match'(https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html)查詢或['query_string'](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)查詢,但不能混用兩者。 – Val
謝謝,這是問題所在。如果您將其添加爲答案,我會將其標記爲已解決。 @vinod_vh給出了相同的答案,如果你不介意的話,我可以接受。 –
隨時接受@vinod_vh答案;-) – Val