php - Elastich search - ICU Collation Keyword Field - Norwegian language - aa elastich search consider as å when sorting
I am using elastic search elasticsearch:6.8.4 on fos in Symfony 4.4 by friendsofsymfony/elastica-bundle": "^5.0"
I am facing an issue with sort field with config in fos_elastica.yaml. My config like:
user_first_name_sort: {type: icu_collation_keyword, language: nb, index: true}
This work fine for Norwegian language as expected. But, word aa elastich search consider as ?? when sorting. Example:
How can i ignore implictly transfer?
Answer
Solution:
According to Wikipedia on the Norwegian alphabet
The letter ?� (HTML å) was introduced in Norwegian in 1917, replacing Aa or aa.
[...]
Family names may not follow modern orthography, and as such retain the digraph aa where ?? would be used today.
and more specifically on the subject of collation
Aa is treated like ?� in alphabetical sorting, not like two adjacent letters A, meaning that while a is the first letter of the alphabet, aa is the last.
Your sort order is correct.
Source