Elasticsearch query_shard_exception无法创建查询

时间:2018-03-03 16:11:39

标签: elasticsearch

我正在尝试在Elasticsearch 6.2中执行以下查询:

GET my_index/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "published": {
              "value": true,
              "boost": 1
            }
          }
        },
        {
          "query_string": {
            "query": "test",
            "fields": [
              "name",
              "description"
            ]
          }
        }
      ]
    }
  }
}

我收到了这个错误

{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "failed to create query: {\n  \"bool\" : {\n    \"must\" : [\n      {\n        \"term\" : {\n          \"published\" : {\n            \"value\" : true,\n            \"boost\" : 1.0\n          }\n        }\n      },\n      {\n        \"query_string\" : {\n          \"query\" : \"test\",\n          \"fields\" : [\n            \"description^1.0\",\n            \"name^1.0\"\n          ],\n          \"type\" : \"best_fields\",\n          \"default_operator\" : \"or\",\n          \"max_determinized_states\" : 10000,\n          \"enable_position_increments\" : true,\n          \"fuzziness\" : \"AUTO\",\n          \"fuzzy_prefix_length\" : 0,\n          \"fuzzy_max_expansions\" : 50,\n          \"phrase_slop\" : 0,\n          \"escape\" : false,\n          \"auto_generate_synonyms_phrase_query\" : true,\n          \"fuzzy_transpositions\" : true,\n          \"boost\" : 1.0\n        }\n      }\n    ],\n    \"adjust_pure_negative\" : true,\n    \"boost\" : 1.0\n  }\n}",
        "index_uuid": "9R0Sz_zBTtmzrZ-WFj_I9w",
        "index": "my_index"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "my_index",
        "node": "ATA0gX7XQeCXwpsUfTNbsg",
        "reason": {
          "type": "query_shard_exception",
          "reason": "failed to create query: {\n  \"bool\" : {\n    \"must\" : [\n      {\n        \"term\" : {\n          \"published\" : {\n            \"value\" : true,\n            \"boost\" : 1.0\n          }\n        }\n      },\n      {\n        \"query_string\" : {\n          \"query\" : \"test\",\n          \"fields\" : [\n            \"description^1.0\",\n            \"name^1.0\"\n          ],\n          \"type\" : \"best_fields\",\n          \"default_operator\" : \"or\",\n          \"max_determinized_states\" : 10000,\n          \"enable_position_increments\" : true,\n          \"fuzziness\" : \"AUTO\",\n          \"fuzzy_prefix_length\" : 0,\n          \"fuzzy_max_expansions\" : 50,\n          \"phrase_slop\" : 0,\n          \"escape\" : false,\n          \"auto_generate_synonyms_phrase_query\" : true,\n          \"fuzzy_transpositions\" : true,\n          \"boost\" : 1.0\n        }\n      }\n    ],\n    \"adjust_pure_negative\" : true,\n    \"boost\" : 1.0\n  }\n}",
          "index_uuid": "9R0Sz_zBTtmzrZ-WFj_I9w",
          "index": "my_index",
          "caused_by": {
            "type": "number_format_exception",
            "reason": "For input string: \"true\""
          }
        }
      }
    ]
  },
  "status": 400
}

我是Elasticsearch的新手。任何帮助将不胜感激。

0 个答案:

没有答案