ElasticSeach Query Error in Aggregation

Hi Colin,

Thanks it worked !

Now suppose if i want to aggregate along with range (currently the query is on date range) and also on a specific field type (ex. type_a = 23).

GET /index1/table1/_search
{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"start_timestamp": {
"gte": 1430483327935,
"lte": 1432988927935
}
}
}
],
"must": [
{"term": {
"type_a":23
}
}
],
"must_not": []
}
}
},
"aggs": {
"custom_id": {
"terms": {
"field": "custom_id"
},
"aggs": {
"spe": {
"sum": {
"field": "x_count"
}
}
}
}
}
}

  • Error
    nested: ElasticsearchParseException[Expected field name but got START_OBJECT "aggs"]; }]",
    "status": 400