Accessing context in script for ranges


Let's say I'm doing the following date ranges aggregation:

"aggs": {
"foo": {
"date_range": {
"script": "??",
"ranges": [
{"from": "2014-01-01", "to": "2014-02-01"},
{"from": "2014-02-01", "to": "2014-03-01"}

Is there any way I can get access to the range context inside the script?
In this case, I'd like to be able to have access to the "from" or "to"
values, when the range is executed. I've tried to use "from", "ctx.from",
"context.from", but it does not seem to work :(.


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
To view this discussion on the web visit
For more options, visit