Elasticsearch 7.10.2 wildcard字段通配符查询命中总数频繁变动求助
Elasticsearch 7.10.2 Wildcard 字段通配符查询异常
基础信息
- 当前使用的 Elasticsearch 版本为
7.10.2 - 异常触发场景:wildcard 类型字段配合通配符查询时,结果稳定性不符合预期
复现用查询DSL
{ "_source": "brand_name", "query": { "wildcard": { "brand_name": { "value": "*wUg*" } } }, "sort": [ { "shop_id": { "order": "desc" } } ] }
异常现象
- 执行完全相同的查询请求时,每次返回的命中总条数都会发生变化
- 相同查询的返回结果配套2张过程截图,可直观对比两次执行的结果差异
- 查阅官方公开文档未检索到对应问题的原因说明,需要技术人员协助排查定位
附:目标索引配置
索引名称:wildcard_query_1000w
{ "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" } } } } } } } } }
内容的提问来源于stack exchange,提问作者DavidDai
相关产品推荐
相关产品推荐

