Hi,
We are experimenting elasticsearch 1.0.0, and are particularly excited
about the new aggregation feature.
Here is one of our use-case that we would like to optimize :
Right now, to imitate a basic SQL group by query that would look like :
SELECT day, hour, id, SUM(views), SUM(clicks), SUM(video_plays) FROM events
GROUP BY day, hour, id
we are issuing this kind of queries :
{
"size" : 0,
"query":{"match_all":{}},
"aggs" : {
"test_aggregation" : {
"terms" : {
"script" : "doc['day'].date + '-' + doc['hour'].value + '-'
+ doc['id'].value",
"order" : { "_term" : "asc" },
"size":
},
"aggs" : {
"sum_click" : { "sum" : { "field" : "clicks" } },
"sum_views" : { "sum" : { "field" : "views" } },
"sum_video_plays" : { "sum" : { "field" : "video_plays" } }
}
}
}
}
But the perfs for this kind of queries are kind of low. Thus, we would like
to know if there are a more optimized way to get what we want.
Thanks !
Maxime
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/4fc6e81a-6cc2-4050-84f5-4f82b69e9764%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.