Search code examples
elasticsearchnestelasticsearch-6

Changes to simple_query_string query behavior in Elasticsearch 6


After upgrading from Elasticsearch 5.6.8 to 6.2.4, I am noticing a change to the behavior of simple_query_string that I can't seem to find documented in the breaking changes. If you run the following against both versions, you will see that "Test *" would match "Test Value" in 5, but no longer matches in version 6. Did I miss something in the upgrade notes, and is there a way to replicate the 5.X behavior in 6.X?

PUT test_query
{
  "mappings": {
    "test_type": {
      "properties": {
          "my_field": {
            "type": "text",
            "analyzer": "standard"
          }
        }
    }
  }
}

POST /test_query/test_type
{
  "my_field": "Test Value Here"
}

GET test_query/_search
{
  "query": {
    "simple_query_string": {
      "fields": [
        "my_field"
      ],
      "query": "Test *",
      "default_operator": "and"
    }
  }
}

Solution

  • This is a bug and will be fixed in a future release https://github.com/elastic/elasticsearch/pull/28871.