Specify sorting collation, or sort collation on a script field


(Joacim Wiell) #1

Hello, I have read the documentation about sorting and I have a question about collation. Is it possible to pass in the collation to be used when sorting the data on a raw field (not_analyzed)?
If this is not possible, is there a way to write a scripted sort field (either a native script or in any of the available languages for scripting) that will take a specified collation and sort by it?

What I'm trying to get from this is, we have data in 23 different languages, users (have a language I want to sort by) can match data in all languages not only the language they have specified. What I'm trying to avoid is to have the data duplicated in multiple fields and only to have a raw field (not_analyzed) and the string in field set to the language the data have, then query the data and sort it on the raw (string) field and using the users language as collation to get it in the correct order.


(system) #2