在Elasticsearch中对_all的模糊性 [英] Fuzziness to _all in Elasticsearch
本文介绍了在Elasticsearch中对_all的模糊性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否有一种方法可以应用模糊化到_all在Elasticsearch中。
I'm wondering if there is a way to apply fuzziness to _all in Elasticsearch.
我尝试了以下查询,但未成功。
I tried the following query without success.
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
}
推荐答案
以下查询对我有用。
curl -XGET localhost:9200/superindex/_search?pretty -d '{"query": {"multi_match": {"query": "dmentia", "fields": "_all", "fuzziness": "AUTO"}}, "from": 0, "size": 2}'
这篇关于在Elasticsearch中对_all的模糊性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文