Lowercase normalizer and backslash in 8.19.x

I have a field defined as such:

"myfield": { -
"type": "keyword",
"store": true,
"fields": {-
"lowercase": {-
"type": "keyword",
"normalizer": "lowercase"
}
}
},

this stores the value in the original case and additionally a lower case variant. The lower case variant is created by Elasticsearch while storing/changing the document.

A value “AbC\\dEf” is stored as “abc\\def” in the lowercase sub-field (note this is in JSON notation, where a backslash mask a special character; so in reality there is only one backslash).

This worked till 8.18.5.

In 8.19.0 - 8.19.2 it stores the value as “abc\\\\def” and the value can’t be found anymore when I search with “abc\\def”.

Is this an intended behavior?

Just checked: It works in 8.18.5 and lower and 9.0.5.

It doesn’t work (means doubled backslashes) in 8.19.0-8.19.2 and 9.1.2.

Hi, thanks for reporting. That sounds like a bug, would you greatly mind opening an issue at https://github.com/elastic/elasticsearch/issues?

Thanks!

Created an issue: lowercase normalizer doubles backslashes in 8.19.x and 9.1.x · Issue #134023 · elastic/elasticsearch · GitHub

Thank you! We’ll get it triaged to the right team. Appreciate you finding it and logging the bug!