I had a similar problem as asked here.
I was running the following query in the head plugin, any request tab (with _search endpoint and GET):
{
"query": {
"match": {
"body": "mulla"
}}}
all my documents were a hit and all had score of 1, with explain saying something like ConstantScore(*:*).
In the linked question someone replied that you have to be sure to use POST and not GET, which works as expected (returning a subset of all documents with different scores).Which is my question why POST and not GET? Comparable examples in the elasticsearch guide say to use GET.
Also if I run the same request with curl:
curl -i -XGET 'http://localhost:9200/dagb/_search' -d '
{
"query": {
"match": {
"body": "mulla"
}}}'
It works as expected, giving same scores and documents as the POST request, in the head plugin. Additionally I just checked , the curl version with -XPOST also works.
Using google chrome developer tools, you can see the request that is performed. If you use the head plugin and change the type of request from POST to GET, the json document is not send as the body. The json document is appended to the request. That is not supported by elasticsearch. The request has to be send as a request body. Using curl you do send it as a body. Below an example of the executed request.
http://localhost:9200/gridshore/_search?{%22query%22:{%22match%22:{%22content%22:%22cool%22}}}
In the end elasticsearch treats this query the same as
http://localhost:9200/gridshore/_search