return aggs as array rather than object

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

return aggs as array rather than object

Bobby Richards
Wanting to display term aggregations using d3js, hover the aggregations are dynamic.  

It appears that aggs are returned in an object rather than an array...
for instance if I have to term aggs; agg1 and agg2

the result is {"aggregations":{"term1":data,"term2":data}

that really kills me, as it seems, and would obviously be convenient for me to return the aggs in an array.  I guess normally you can request the aggs by name but I will not be able to know that ahead of time as it will be dynamic.  

too tired but perhaps there is a way to convert the json to an array or have elasticsearch return the aggs as an array?

Thanks,
Bobby

--
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/f4900519-1891-4106-a669-38f43743a76c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: return aggs as array rather than object

Adrien Grand-3
Hi Bobby,

There is no such functionality in elasticsearch so this would have to be done on client side.

On Wed, Apr 15, 2015 at 7:58 AM, Bobby Richards <[hidden email]> wrote:
Wanting to display term aggregations using d3js, hover the aggregations are dynamic.  

It appears that aggs are returned in an object rather than an array...
for instance if I have to term aggs; agg1 and agg2

the result is {"aggregations":{"term1":data,"term2":data}

that really kills me, as it seems, and would obviously be convenient for me to return the aggs in an array.  I guess normally you can request the aggs by name but I will not be able to know that ahead of time as it will be dynamic.  

too tired but perhaps there is a way to convert the json to an array or have elasticsearch return the aggs as an array?

Thanks,
Bobby

--
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/f4900519-1891-4106-a669-38f43743a76c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adrien

--
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/CAO5%3DkAhCtN_8U25Ogwp6GT7Vv7QQ-hEzCsTOOSHRP781J1kVnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.