Median of last top N hits in ElasticSearch -


given elasticsearch index objects like

{   "key": "string",   "creation_date": "date",   "metric":"number" } 

is possible calculate median of metric last n hits (ordered creation_date) of each day?

text steps of such query:

  1. group day using creation_date field
  2. group key
  3. take last n items (ordered creation_date)
  4. calculate median between them

thanks!


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -