0

I am using elastic search 1.6.0. Here is my aggregation query :

GET /a/dummydata/_search

    {
       "size": 0,
       "aggs": {
          "sum_trig_amber": {
             "terms": {
                "field": "TRIGGER_COUNT_AMBER"
             }
          },
          "sum_trig_green": {
             "terms": {
                "field": "TRIGGER_COUNT_GREEN"
             }
          },
          "sum_trig-red": {
             "terms": {
                "field": "TRIGGER_COUNT_RED"
             }
          }
       }
    }

Is there any way by which i can add three sum_trig_amber + sum_trig_red + sum_trig_green ?

Bond
  • 165
  • 2
  • 15
  • Hey @Andrei Stefan, do you know something about this? – Bond Oct 20 '16 at 09:49
  • What do you mean by `add three sum_trig_amber + sum_trig_red + sum_trig_green`? Can you give an example? – Andrei Stefan Oct 20 '16 at 21:55
  • Lets assume sum_trig_amber = 10 ; sum_trig_red = 20; sum_trig_green = 30. Now i want the sum of these three which is 60. I am using ES Version 1.6.0. – Bond Oct 21 '16 at 07:01
  • `terms` aggregation doesn't do a sum. Maybe you wanted to use another aggregation/ – Andrei Stefan Oct 21 '16 at 07:07
  • okey.I am looking for feature like bucket_sum available in ES 2.0.0 – Bond Oct 21 '16 at 09:15
  • That doesn't exist in 1.x obviously. If you can explain this requirement from a different angle (and not referring to bucket sum) we can think about another approach. – Andrei Stefan Oct 21 '16 at 13:38

0 Answers0