我正在尝试设计一个查询,其中我可以使用通配符和模糊查询。
根据我的说法,query_string用于通配符搜索,而multi_match可以用于模糊搜索。
我想要一个可以搜索单词的查询:-
elast:-提供elastic和elasticsearch结果。"elasttc“:-同时提供elastic和elasticsearch两种搜索结果。
弹性搜索同时支持通配符和模糊查询??
先谢谢你...
发布于 2018-09-16 11:14:07
{
"query": {
"bool": {
"should": [
{
"match": {
"title": "testing"
}
},
{
"wildcard": {
"title": "*testing*"
}
},
{
"fuzzy": {
"title": "testing"
}
}
],
"minimum_should_match": 1
}
}
}发布于 2018-09-15 20:10:17
您可以将其与带有通配符的查询字符串一起使用。后缀查询支持带有模糊的前缀查询,您也可以使用字段选择,如multi_match ~AUTO*:
{
"query": {
"query_string" : {
"fields" : ["name^2", "content^1"],
"query" : "elasttc~AUTO*"
}
}
}您也可以使用数值更改AUTO关键字,作为相同的fuzziness参数。
https://stackoverflow.com/questions/52344191
复制相似问题