matizgal
(Mateusz)
January 31, 2017, 8:14pm
1
Please, help me people with my problem.
I've got that mapping:
"some_field: {type: 'string', store: 'true', analyzer: 'keyword'}"
in this field i've got words "Śrem" "Żnin" with polish sign.
When i do sort on this data, elastic returned sorted data:
a,b,c,d,...,z, ś, ł, ż
What's wrong with my sort?
Anybody can help me ? ?
xavierfacq
(Xavier Facq)
February 1, 2017, 8:46am
2
Hi,
Maybe you can try to add the asciifolding filter to normalize all char and have the good sort ?
https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-asciifolding-tokenfilter.html
1 Like
matizgal
(Mateusz)
February 1, 2017, 9:12am
3
Thanks it's good point. But a I have some question.. I must change mapping for that field in my elastic ?
xavierfacq
(Xavier Facq)
February 1, 2017, 10:37am
4
Yes, you have have to change the analyser in the index mapping, then create a new index and re-index your data ...
Something like that:
{
"template" : "your-next-index-name-*",
"order" : 0,
"settings" : {
"analysis": {
"analyzer": {
"polish_asciied": {
"type": "custom",
"tokenizer": "standard",
"filter": [ "lowercase", "asciifolding", "trim" ]
}
}
}
},
"mappings" : {
"your_type": {
"properties": {
"your_polish_field" : {
"type": "string",
"analyzer": "polish_asciied"
}
}
}
}
}
matizgal
(Mateusz)
February 1, 2017, 10:42am
5
You're right. It's working Thanks for help.
1 Like
system
(system)
Closed
March 1, 2017, 10:42am
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.