elasticsearch - Elasticsearch 通配符查询结果命中也发生变化
问题描述
Elasticsearch 版本:7.10.2 目前,我在新版本中遇到了一个关于通配符类型的通配符查询的奇怪问题。我使用 DSL 查询如下
{"_source":"brand_name","query":{"wildcard":{"brand_name":{"value":"*wUg*"}}},"sort":[{"shop_id":{"order":"desc"}}]}
但是相同的查询总命中数总是每次都在变化,我阅读了官方文档并没有找到任何答案。那么有没有高手可以帮忙检查一下这个问题?索引设置
{
"wildcard_query_1000w" : {
"settings" : {
"index" : {
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_content"
}
}
},
"number_of_shards" : "3",
"provided_name" : "wildcard_query_1000w",
"creation_date" : "1614589156629",
"analysis" : {
"normalizer" : {
"lowerasciinormalizer" : {
"filter" : [
"lowercase",
"asciifolding"
],
"type" : "custom"
}
},
"analyzer" : {
"my_analyzer" : {
"filter" : [
"lowercase",
"asciifolding"
],
"tokenizer" : "standard"
}
}
},
"number_of_replicas" : "1",
"uuid" : "SL4M3NLySB6f0MPVhM-v7A",
"version" : {
"created" : "7100299"
}
}
}
}
}
索引映射
{
"wildcard_query_1000w" : {
"mappings" : {
"dynamic_templates" : [
{
"string" : {
"match_mapping_type" : "string",
"mapping" : {
"normalizer" : "lowerasciinormalizer",
"type" : "wildcard"
}
}
}
],
"properties" : {
"brand_name" : {
"type" : "wildcard"
},
"entity_id" : {
"type" : "keyword"
},
"shop_id" : {
"type" : "long"
},
"ssp_doc_ts" : {
"type" : "long"
},
"status" : {
"type" : "long"
},
"toc" : {
"properties" : {
"loyalty" : {
"properties" : {
"tier" : {
"type" : "keyword"
}
}
}
}
}
}
}
}
}
解决方案
推荐阅读
- python - 使用作为 tkinter 按钮中命令的函数的输出
- java - Spring Boot是否可以使用接口作为控制器参数并让spring使用它的实现来实例化它?
- android - Android 相机 X 视口
- java - 如何从语法规则构建 AST 树
- c++ - 使用带有循环和延迟的 ESP_NOW
- ruby-on-rails - 如何在 ruby on rails 中用 n/a 替换空值?
- java - Junit 5 mockito 无法在 Spring Boot 应用程序中读取用 @Value 注释的属性文件
- javascript - 如何将Angular函数返回值存储到变量中
- spring - Spring Boot 中 EJB SessionContext 对象的替换是什么?
- angular - 手动刷新服务器中未找到的页面时