It's funny, I tried to help you and currently have the same problem

Does anyone know how to get date histogram with average field value within

each date entry ? Standard date histogram allows to get count only but I do

not know how to get sum, avg, etc... If I have at least sum I could get avg

by myself.

Thanks for help.

Best regards.

Marcin

2012/4/3 Marcin Dojwa m.dojwa@livechatinc.com

Hi,

Check date_histogram facet described here:

http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html

Just give "interval":"minute"

Then you have to work out how to return avg not count for each minute but

I guess this can be done using "Script Value Field" (also described there).

Best regards.

2012/4/3 Wang Yong cnwangyong@gmail.com

Hi!

I am using elasticsearch to store a serial values of a metric like

{timestamp, value}. Now, I am trying to calculate the average of this

metric of each minute in some time range. I did this by a filter to get all

docs in that minute and calculate the avg and then the next minute. So I

have to do a searching for every minute and the performance was terrible.

Is there any sugestion for a better algorithm for better performance? Thank

you for any comment!

Alan