I am try to find the average price of car based on condition of the car


(Jason Smith) #1

But I don't get the result.

"aggregations": {
"car-condition": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}

     GET /vehicles/_search
     {
        "aggs": {
            "car-condition": {
                      "terms": {
                            "field": "{condition.keyword}"
                      },
                     "aggs": {
                             "car-avg-price": {
                                     "avg": {
                                             "field": "price"
                                      }
                         }
                   }
           }
        
      }
  }

(kulkarni) #2

This looks like more of an ES question. Can you please post this in the ES discuss forums to get a faster answer,

http://discuss.elastic.co/c/elasticsearch

Thanks
Rashmi


(Jason Smith) #3

Ok. Thank You Rashmi.


(Christian Dahlqvist) #4

I believe this should be "field": "condition.keyword".


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.