Accessing context in script for ranges

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Accessing context in script for ranges

Michaël Gallego
Hi,

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 :(.

Thanks

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5021b5a1-78fe-4d7c-bc43-d7c653381f19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.