1

I am using elasticsearch6 for one of my project. I am simply running some aggregation queries it but aggregations are not working. It is returning me hits even when the _source:false in request body.

My query is like this

{
   "size": 0,
   "_source": [
       "id"
    ],
  "aggs": {
    "countries": {
        "terms": {
            "field": "country_id"
          }
     }
   }
 } 

and rather than returning the aggregates it is returning me the source of the documents. I am using elasticsearch head plugin to run the query

Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
  • 2
    Look at this answer which may help: https://stackoverflow.com/questions/34795053/es-keeps-returning-every-document/34796014#34796014 (hint: use POST instead of GET) – Val Nov 19 '17 at 05:24
  • yeah, right, i just moved from elastic 1.7 to 6. previously i was using sense, but because sense doesn't work now so i moved elastic head and got this issue. With post requests it is working fine. – Sarfraj Ahmed Nov 19 '17 at 05:53

0 Answers0