mmaury
October 18, 2018, 1:05pm
1
Hi all !
I want to set up a case-insensitive sort order in an aggregation , made from a keyword field.
Apparently, it wasn't possible with ES 5.2 (see Keyword type: aggregation case insensitive ).
I tried to deal with it on ES 6.4, but without success, using "icu_collation_keyword " subfield and "bucket sort aggregation ".
Is it at least possible, in this version (6.4) ?
Has anyone already implemented it ?
If the answer is yes, so how ?
Thanks !
dadoonet
(David Pilato)
October 18, 2018, 1:22pm
2
mmaury
October 18, 2018, 1:40pm
3
Hi @dadoonet !
I don't think so, because I want my aggregation returns original values, not normalized.
My values (people names) are international, I want to keep uppercase and accents (that's why I test with the ICU plugin).
1 Like
xeraa
(xeraa)
October 18, 2018, 1:59pm
4
You could add an additional field with the normalizer just for sorting? So you have both the original value and the normalized one.
mmaury
October 18, 2018, 2:12pm
5
Hi @xeraa !
I tried this with Bucket Sort Aggregation, but ES tells me :
buckets_path must reference either a number value or a single value numeric metric aggregation
My aggregation looks like this, where "creator " is my keyword field and "creator.sort " my "icu_collation_keyword " subfield :
{
"aggs": {
"personnes": {
"terms": {
"field": "creator",
"min_doc_count": 1
},
"aggs": {
"creator_sort": {
"terms": {
"field": "creator.sort"
}
},
"personnes_bucket_sort": {
"bucket_sort": {
"sort": [
{
"creator_sort": {
"order": "asc"
}
}
],
"size": 50
}
}
}
}
}
}
Maybe I'm doing wrong ?
system
(system)
Closed
November 16, 2018, 9:07am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.