You need to enable JavaScript to run this app. Elasticsearch 7.10.2 wildcard字段通配符查询命中总数频繁变动求助
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.01 06:15:06