Maxime, your bottleneck is likely in the script part. It has to dynamically compute that per doc just like in sql. However, if you can precompute that at index time (for example, introduce a field that contains the value of date-hour-id, you should be able to improve that aggregation time significantly. I did a quick test in 1.0 RC1 with an index of about 100K docs, and if I precompute that term field (and eliminate the script part), it is at least 10x faster than the script version. YMMV.
-- 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/b3b87708-4435-40bb-9182-1f2a843f31c7%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
