Sorting strings containing numbers


(nicco) #1

Hi everyone,

I need to sort some string fields that contain numbers and I would
like that:
"abc10" should appear after "abc7"

Unfortunately I don't know the structure of these strings so it has to
be a bit generic.

I'm now using itu collation but it seems not to work. Here is my index
declaration

{
"analysis" : {
"analyzer" : {
"collation" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}

and the field is:

id: {type: "string", null_value : "", analyzer : "collation"},

any ideas??

Thanks!


(system) #2