No aggregation node in result


(jerome) #1

I want aggregrate records by "_type" field with Javascript client running in browser:
The code is pretty simple:

And in result is only returns:
TRACE: 2015-06-09T11:41:19Z
-> POST http://192.168.102.241:9200/logstash-*/_search?search_type=count&ignore_unavailable=true&size=0&aggregations=

<- 200
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 59451,
"max_score": 0,
"hits": []
}
}

no "aggregation node in result", while I try use CURL,
it returns:
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 59451,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"bairro_count" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [ {
"key" : "proeuction",
"doc_count" : 59451
} ]
}
}
}

Is there any missing in my code?


(system) #2