弹性条款聚合返回0的关键字

时间:2018-11-13 11:54:38

标签: elasticsearch elasticsearch-aggregation

以下聚合即使在索引中有数据时也返回0。

GET index_name/index_type/_search
{
"size": 0,
  "aggs": {
   "trms": {
    "terms": {
      "field": "su_name.keyword",
      "size": 10
  }
}

} }

以下是该索引的映射:

"properties": {
      "event_seq_no": {
        "type": "long"
      },
      "event_time": {
        "type": "date"
      },
      "status": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 500
          }
        },
        "fielddata": true
      },
      "su_name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 500
          }
        },
        "fielddata": true
      },
      "transaction_id": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        },
        "fielddata": true
      }
    }
  }
}

我还有其他具有相似映射和数据的索引,并且能够获取唯一的su_name。但是对于该特定索引,它返回0。任何人都可以解释一下吗?

0 个答案:

没有答案