Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
    }
  }
}
like image 336
Carl Nunes Avatar asked Feb 25 '26 13:02

Carl Nunes


1 Answers

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

like image 136
Carl Nunes Avatar answered Feb 27 '26 02:02

Carl Nunes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!