一尘不染

在Elasticsearch中对_all的模糊性

elasticsearch

我想知道是否有一种方法可以在Elasticsearch中将模糊性应用于_all。

我尝试以下查询未成功。

curl -XGET localhost:9200/superindex/_search?pretty -d '{"query": {"match": {"_all": "hapiness", "fuzziness": "AUTO"}}, "from": 0, "size": 2}'

收到错误。

{
  "error" : {
    "root_cause" : [ {
      "type" : "query_parsing_exception",
      "reason" : "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?",
      "index" : "carenotes_etl",
      "line" : 1,
      "col" : 40
    } ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [ {
      "shard" : 0,
      "index" : "carenotes_etl",
      "node" : "cMRfwQ3eS12eVkjfMOHYuQ",
      "reason" : {
        "type" : "query_parsing_exception",
        "reason" : "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?",
        "index" : "carenotes_etl",
        "line" : 1,
        "col" : 40
      }
    } ]
  },
  "status" : 400
}

阅读 311

收藏
2020-06-22

共1个答案

一尘不染

以下查询对我有用。

curl -XGET localhost:9200/superindex/_search?pretty -d '{"query": {"multi_match": {"query": "dmentia", "fields": "_all", "fuzziness": "AUTO"}}, "from": 0, "size": 2}'
2020-06-22