The equivalent would likely be a terms agg on the key_script expression 
(using the terms agg script capability), and then followed by a nested 
stats agg on the value_script expression (using the stats agg script 
capability). Something like this:

  "aggs": {
    "by-hour": {
      "terms": {
        "script": "doc['media.created_time'].date.hourOfDay"
      },
      "aggs": {
        "bytes_stats": {
          "stats": {
            "script": "doc['media.likes.count'].value + 
doc['media.comments.count'].value"
          }
        }
      }
    }
  }

-- 
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/7d285a99-84f0-430b-a86d-1365cc05e13f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to