2015-09-28 110 views
0

我有Elasticsearch中的1200個條目的小數據,這些數據自動輸入到文檔類型的映射字段中。浮動浮動,雙倍浮動。 當承擔 '統計' 像數據的 'AGGS':elasticsearch在統計聚合上返回null

GET /statsd-2015.09.28/timer_data/_search 
{ 
    "query" : { 
     "filtered" : { 
      "query" : { "match_all" : {}}, 
       "filter" : { 
        "range" : { "ns" : { "lte" : "gunicorn" }} 
       } 
      } 
     }, 
     "aggs" : { 
      "value_val" : { "stats" : { "field" : "u'count_90'" } } 
     } 
} 

我得到空的回報是這樣的:

... 
"aggregations": { 
     "value_val": { 
     "count": 0, 
     "min": null, 
     "max": null, 
     "avg": null, 
     "sum": null 
     } 
    } 
... 

這裏是我的字段映射:

{"statsd-2015.09.28":{"mappings":{"timer":{"properties":{"@timestamp":{"type":"string"},"act":{"type":"string"},"grp":{"type":"string"},"ns":{"type":"string"},"tgt":{"type":"string"},"val":{"type":"float"}}},"gauge":{"properties":{"@timestamp":{"type":"string"},"act":{"type":"string"},"grp":{"type":"string"},"ns":{"type":"string"},"tgt":{"type":"string"},"val":{"type":"float"}}},"counter":{"properties":{"@timestamp":{"type":"string"},"act":{"type":"string"},"grp":{"type":"string"},"ns":{"type":"string"},"tgt":{"type":"string"},"val":{"type":"float"}}},"timer_data":{"properties":{"@timestamp":{"type":"double"},"act":{"type":"string"},"count":{"type":"float"},"count_90":{"type":"float"},"count_ps":{"type":"float"},"grp":{"type":"string"},"lower":{"type":"float"},"mean":{"type":"float"},"mean_90":{"type":"float"},"median":{"type":"float"},"ns":{"type":"string"},"std":{"type":"float"},"sum":{"type":"float"},"sum_90":{"type":"float"},"sum_squares":{"type":"float"},"sum_squares_90":{"type":"float"},"tgt":{"type":"string"},"upper":{"type":"float"},"upper_90":{"type":"float"}}}}}} 

我想問的是爲什麼我的輸出不需要?我怎樣才能得到它?

+0

我從你身上看到映射,你的字段被稱爲'count_90',或者它是'u'count_90'嗎?就像你在聚集中寫的那樣? –

回答

0
GET /statsd-2015.09.28/timer_data/_search 
{ 
    "query" : { 
     "filtered" : { 
      "query" : { "match_all" : {}}, 
       "filter" : { 
        "range" : { "ns" : { "lte" : "gunicorn" }} 
       } 
      } 
     }, 
     "aggs" : { 
      "value_val" : { "stats" : { "field" : "count_90" } } 
     } 
} 

我是新來的,但我意識到,字段名稱不是我使用的。在此之後,一切都變得清晰。

+0

好你意識到:) –