我正在尝试设计一个查询,我可以在其中一起使用通配符和模糊查询。
据我所知, query_string 用于通配符搜索, multi_match 可用于模糊。
我想要一个将搜索单词的查询:-
"elast": - 提供弹性和 Elasticsearch 结果。
"elasttc":- 还提供弹性和 Elasticsearch 的结果。
Elasticsearch 同时支持通配符和模糊查询??
提前致谢...
最佳答案
{
"query": {
"bool": {
"should": [
{
"match": {
"title": "testing"
}
},
{
"wildcard": {
"title": "*testing*"
}
},
{
"fuzzy": {
"title": "testing"
}
}
],
"minimum_should_match": 1
}
}
}
关于elasticsearch - 通配符和模糊查询在 Elasticsearch 中一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52344191/