GET index/_search
{
"query": {
"bool": {
"should": [
{
"query_string": {
"default_operator": "AND",
"default_field": "searchText",
"query": "rob",
"fuzziness": "AUTO"
}
}
]
}
}
}
这是字段searchText的Map
"searchText" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
搜索查询没有返回任何包含值bob作为searchText一部分的文档。是否必须以其他方式更新查询以避免模糊
1条答案
按热度按时间j7dteeu81#
可以使用
~
运算符在query_string中进行模糊搜索:或者你可以使用一个带有“模糊性”的匹配查询:“自动”