Hi,
I'm trying to apply the "Sort by function
<https://wiki.apache.org/solr/FunctionQuery#Sort_By_Function>" solr
capabilities to solve the following use case :

I have a "country" field in my index, with values like 'US', 'FR', 'UK',
etc...

Then I want our users to be able to define the order of their preferred
countries so that grouped results are sorted according to their preference.

I need something like the map function, that assigns a number to each
country code and use that for sorting, based on the users' preference.

I tried to sort my groups by adding something like map(country, 'FR', 'FR',
1) to the field list, but map seems to only work for numerical values. I
get errors like :

Error parsing fieldname: Expected float instead of quoted string:FR

Is there any other function that would allow me to map from a predefined
String constant into an Integer that I can sort on ?

Thanks in advance.

Reply via email to