首页 > 解决方案 > SOLR 查询返回值,但 stats.countDistinct 仍然缺失

问题描述

这是我的 solr 查询,结果返回了一些值,但无法计算 distinct :

"stats.field":"deviceId"
"numFound":38
"deviceId":"11004084101MTVCN240D63C00010"
"missing":38
"distinctValues":[]

这是完整的回复:

{
  "responseHeader": {
    "status": 0,
    "QTime": 0,
    "params": {
      "q": "*:*",
      "stats.calcdistinct": "true",
      "indent": "on",
      "stats": "on",
      "start": "0",
      "fq": [
        "creationTime:[\"2018-10-19\" TO \"2018-10-19 23:59:59\"]",
        "tenant:mailink.MKH13.KVMB.DXHN1"
      ],
      "rows": "1",
      "wt": "json",
      "stats.field": "deviceId"
    }
  },
  "response": {
    "numFound": 38,
    "start": 0,
    "docs": [
      {
        "creationTime": "2018-10-19 21:13:55",
        "deviceId": "11004084101MTVCN240D63C00010",
        "tenant": "mailink.MKH13.KVMB.DXHN1",
        "status": 0,
        "id": "685b041f-91af-424f-9e9d-b06db9fbcd94",
        "_version_": 1614767301005934600
      }
    ]
  },
  "stats": {
    "stats_fields": {
      "deviceId": {
        "min": null,
        "max": null,
        "count": 0,
        "missing": 38,
        "distinctValues": [],
        "countDistinct": 0
      }
    }
  }
}

任何帮助表示赞赏:) 谢谢!

标签: solrcountstatisticsdistinct

解决方案


推荐阅读