diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

Fails when making a search to ES #40

Closed neumachen closed 7 years ago

neumachen commented 7 years ago
http://localhost:9200/

GET _search?
{
  "query": {
    "query_string": {
      "default_field": username,
      "query": "k* OR m* OR h*"
    }
  }
}

This returns this error:

HTTP/1.1 400 Bad Request
content-type: application/json; charset=UTF-8
content-length: 477

{
    "error": {
        "reason": "request [/_search] contains unrecognized parameter: [{  \"query\": {    \"query_string\": {      \"default_field\": username,      \"query\": \"k* OR m* OR h*\"    }  }}]",
        "root_cause": [
            {
                "reason": "request [/_search] contains unrecognized parameter: [{  \"query\": {    \"query_string\": {      \"default_field\": username,      \"query\": \"k* OR m* OR h*\"    }  }}]",
                "type": "illegal_argument_exception"
            }
        ],
        "type": "illegal_argument_exception"
    },
    "status": 400
}

But the query passes when done through Sense.

neumachen commented 7 years ago

My bad, didn't realize that you'd need to use POST with a body.