【问题标题】:Fuzziness to _all in ElasticsearchElasticsearch 中 _all 的模糊性
【发布时间】:2023-03-20 13:48:01
【问题描述】:

我想知道是否有办法将fuzziness 应用于 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
}

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    以下查询对我有用。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-06
      • 2019-07-18
      • 2019-05-08
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-05
      相关资源
      最近更新 更多