Hey guys, one quick question.
I have a set of example records:
Test
123 sesi
501 Alva
rout
and I want those to be sorted in asc/desc order in case insensitive and alphabeticall order, just like this:
501 Alva
rout
123 sesi
Test
so as you can see the first letter is dictating the order from A-Z (or other way around).
How can I achieve that? Right now what I was able to achieve is case insensitive sorting through the normalizer so it sorts like this:
123 sesi
501 Ava
rout
Test
but the problem is that numbers are being sorted first and then the letters. Any ideas how can I solve this? I'm sharing with you guys my current configuration.
"normalizer": {
"my_normalizer": {
"type": "custom",
"char_filter": [],
"filter": ["lowercase", "asciifolding"]
}
}
and then I'm using is as:
"mappings": {
"dynamic_templates": [
{
"data_key": {
"mapping": {
"type": "keyword",
"normalizer": "my_normalizer",
"index_options": "docs",
"copy_to": "all_search_fields"
},
"match": "*_*_key"
}
},
{
"data_string": {
"mapping": {
"norms": false,
"type": "text",
"fields": {
"raw": {
"type": "keyword",
"index_options": "docs",
"normalizer": "my_normalizer"
}
},
"index_options": "positions",
"copy_to": "all_search_fields"
},
"match": "*_*_string"
}
}
]