Java API "extended_bounds" Not Working?

Hi Guys,

I'm trying to run a Date Histogram aggregation, with extended_bounds that
cover (now-7d) -> now, and return 0 doc-count buckets. This works perfectly
in Sense, but when running in Java, the response does not include
my extended bounds. Strange part is, debugging the program reveals that
Java API sends the correct request (in JSON format), but receives a
different response than the one I'm getting in Sense.

Request sent (as seen in Java debug):
{
"size" : 0,
"query" : {
"filtered" : {
"query" : {
"range" : {
"created_at" : {
"from" : "now-7d",
"to" : null,
"include_lower" : true,
"include_upper" : true
}
}
},
"filter" : {
"term" : {
"id" : "12345678"
}
}
}
},
"fields" : [ ],
"aggregations" : {
"interactions_per_day" : {
"date_histogram" : {
"field" : "created_at",
"interval" : "1d",
"min_doc_count" : 0,
"format" : "MM-dd-yyyy",
"extended_bounds" : {
"min" : "now-7d",
"max" : "now"
}
}
}
}
}

Response received in Sense:
{
"took": 8,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 30,
"max_score": 0,
"hits": []
},
"aggregations": {
"interactions_per_day": {
"buckets": [
{
"key_as_string": "10-03-2014",
"key": 1412294400000,
"doc_count": 0
},
{
"key_as_string": "10-04-2014",
"key": 1412380800000,
"doc_count": 0
},
{
"key_as_string": "10-05-2014",
"key": 1412467200000,
"doc_count": 9
},
{
"key_as_string": "10-06-2014",
"key": 1412553600000,
"doc_count": 0
},
{
"key_as_string": "10-07-2014",
"key": 1412640000000,
"doc_count": 7
},
{
"key_as_string": "10-08-2014",
"key": 1412726400000,
"doc_count": 13
},
{
"key_as_string": "10-09-2014",
"key": 1412812800000,
"doc_count": 1
},
{
"key_as_string": "10-10-2014",
"key": 1412899200000,
"doc_count": 0
}
]
}
}
}

Response in Java:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 54,
"successful" : 54,
"failed" : 0
},
"hits" : {
"total" : 30,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"interactions_per_day" : {
"buckets" : [ {
"key_as_string" : "10-05-2014",
"key" : 1412467200000,
"doc_count" : 9
}, {
"key_as_string" : "10-06-2014",
"key" : 1412553600000,
"doc_count" : 0
}, {
"key_as_string" : "10-07-2014",
"key" : 1412640000000,
"doc_count" : 7
}, {
"key_as_string" : "10-08-2014",
"key" : 1412726400000,
"doc_count" : 13
}, {
"key_as_string" : "10-09-2014",
"key" : 1412812800000,
"doc_count" : 1
} ]
}
}
}

What am I missing? Here's my Java code:
FilterBuilder filter = FilterBuilders.termFilter("id", id);
QueryBuilder query =
QueryBuilders.rangeQuery("created_at").gte("now-7d");

    AggregationBuilder aggs = AggregationBuilders
            .dateHistogram("interactions_per_day")
            .field("created_at")
            .format("MM-dd-yyyy")
            .minDocCount(0l)
            .extendedBounds("now-7d", "now")
            .interval(DateHistogram.Interval.DAY);

    SearchRequestBuilder request = elasticsearchPool.prepareSearch()
            .setQuery(QueryBuilders.filteredQuery(query, filter))
            .addAggregation(aggs)
            .setNoFields()
            .setSize(0);

    SearchResponse search = request
            .execute()
            .actionGet();

Any help or insight would be greatly appreciated...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3a553804-702d-4038-88cd-2cb0efef0995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.