I'm in the process of upgrading a project from ES 1.7 to ES 5.1 and noticed an integration test failing.
Below is a minimal repro case.
When searching using a wildcard search for "brö" I get in both versions the same result. When searching using "brö{"/)?" which gets escaped as "brö\{\\\"\/\)", I get 2 results in ES 1.7 and no results in ES 5.1.
I searched breaking changes of ES 2.x and ES 5.x but could not find anything related to that. Also searched for new query string search settings which could help in that regard but couldn't find it either.
If you have any idea what's going on, please let me know Thanks.
Repro case:
ES 5 index creation
curl -X PUT 'http://localhost:9200/testwildcard' -d '{
"mappings": {
"testwildcard": {
"properties": {
"name": {
"type": "keyword",
"fields": {
"search": {
"type": "text"
}
}
}
}
}
}
}'
ES 1.7 index creation
curl -XPUT 'http://localhost:9200/testwildcard' -d '{
"mappings": {
"testwildcard": {
"properties": {
"name": {
"type": "string",
"analyzed": "not_analyzed",
"fields": {
"search": {
"type": "string"
}
}
}
}
}
}
}'
Insert data
curl -XPUT 'http://localhost:9200/testwildcard/testwildcard/1' -d '{
"name": "Brötchen"
}'
curl -XPUT 'http://localhost:9200/testwildcard/testwildcard/2' -d '{
"name": "Frischbackbrötchen"
}'
curl -XPUT 'http://localhost:9200/testwildcard/testwildcard/3' -d '{
"name": "Brot"
}'
works in both ES 1.7 and ES 5.1:
curl -XPOST 'http://localhost:9200/testwildcard/_search' -d '{
"explain": true,
"query": {
"query_string": {
"query": "name.search:*brö*",
"analyze_wildcard": true,
"default_operator": "AND"
}
}
}'
doesn't work in ES 5.1 but works in ES 1.7:
curl -XPOST 'http://localhost:9200/testwildcard/_search' -d '{
"explain": true,
"query": {
"query_string": {
"query": "name.search:*brö\\{\\\\\\\"\\/\\)*",
"analyze_wildcard": true,
"default_operator": "AND"
}
}
}'