Query string query does not works if it ends with - , is this a bug or this is how it works

Hello , I have seen an strange behavior with query string query , does anyone have any idea for same..
Basically query string query does not works if search term ends with - , where as in between - works fine..

For Ex :

Does not works...
POST elastiflow-2018.03.07/_search
{
  "query": {
    "query_string": {
      "default_field": "event.type",
      "query": "ipfix -",
      "default_operator": "OR"
    }
  }
}
Works fine...
POST elastiflow-2018.03.07/_search
{
  "query": {
    "query_string": {
      "default_field": "event.type",
      "query": "ipfix -test - hello",
      "default_operator": "OR"
    }
  }
}

POST elastiflow-2018.03.07/_search
{
  "query": {
    "query_string": {
      "default_field": "event.type",
      "query": "ipfix - ",
      "default_operator": "OR"
    }
  }
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.