-1

hi I'm new to elastic search and when i try a aggregate query it is not returning any results.

http://localhost:9200/contract/_search?search_type=count
    {
      "aggregations": {
        "status_cons": {
          "terms": {
            "field": "data.policyStatus",
            "size": 0
          }
        }
      }
    }

Note: this is just one of the queries that i had tried ,I have give size as 0 with the query and remove the search type ,added a query term with match_all etc

found out this is a bug in the head plugin. GET method doesn't work using the head plugin.

Related dicussion :Different result when using GET/POST in elastic search

no results for aggregation

Community
  • 1
  • 1
Ramkumar V
  • 21
  • 5

1 Answers1

2

it worked at last !!!!! .please use a POST request when using the elastic search head plugin it .

Ramkumar V
  • 21
  • 5
  • Then where you were putting your query?It should be a POST request. Haven't you gone through the documentation? – Nakul91 Apr 21 '16 at 13:19
  • I was using a Get request instead of a POST and I did take a look at the documentation as well and GET is a valid method refer: https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html http://stackoverflow.com/questions/14339696/elasticsearch-post-with-json-search-body-vs-get-with-json-in-url – Ramkumar V Apr 22 '16 at 06:34