要不要也来分享分享一下啊

求助:ES去重已添加"precision_threshold":40000,但结果不准确的问题

Elasticsearch | 作者 Elastic_Cdw | 发布于2019年05月22日 | 阅读数:5804

根据订单号去重,返回去重后订单总数

查询条件:
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "record_type": "2"
          }
        }
      ],
      "filter": {
        "range": {
          "buyer_pay_time": {
            "gte": "2019-05-21",
              "lte": "2019-05-21"
          }
        }
      }
    }
  },
 "aggs": {
    "distinct_esc_order_id": {
      "cardinality": {
        "field": "esc_order_id",
        "precision_threshold":40000
      }
    }
  },
  "size": 0
}
 
结果:
{"took":18,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":9853,"max_score":0.0,"hits":[]},"aggregations":{"distinct_esc_order_id":{"value":9816}}}
 
 
实际去重之后的订单数应该是9815
 
已将9853条订单导出,在excel中对订单号去重,结果确实是9815,

不明白的是数据9853条数据应该在40000限制范围,出现去重结果不准
 
各位大神是否有好的方法解决
 
 
已邀请:

要回复问题请先登录注册