According to the ES documentation, those 2 search request should get the same results:
GET
http://localhost:9200/app/users/_search?source={"query": {"term": {"email":"foo@gmail.com"}}}
POST
http://localhost:9200/app/users/_search
Post body :
{
"query": {
"term": {
"email":"foo@gmail.com"
}
}
}
But the first one gives no result while the second one gives me the expected result. I use ES version 0.19.10 Did anybody else have the same behavior ? Is this a bug ?
source
is not a valid query string argument according to http://www.elasticsearch.org/guide/reference/api/search/uri-request/Elasticsearch allows three ways to perform a search request...
GET with request body:
POST with request body:
Since not all clients support GET with body, POST is allowed as well.
GET without request body:
or (if you want to manually URL encode your query string)
You should URL encode your query in the first case: