When ordering results from Azure Search, the sort order of the results is that string values that start with numbers or special characters come before string values that start with letters.
As best I can tell, the default ordering rules for the first letter of the order-by field is:
! ” # $ % & ' () * + , - ./. 0 1 2 3 4 5 6 7 8 9. :;< = >? @. A B C D E F G H I J K L M N...
In order to fulfill business requirements, I need a custom ordering of the resulting values like the following:
A B C D E F G H I J K L M N.! ” # $ % & ' () * + , - ./. 0 1 2 3 4 5 6 7 8 9. :;< = >? @. ...
This sort order is desired to display product descriptions that start with letters before product descriptions that start with numbers or special characters.
Is there a way to customize the default ordering in Azure Search?
If not, is there some other way to accomplish this business requirement? Perhaps somehow weighting product descriptions that start with letters to have a more weight than those that don't... but I think that would have to happen when the data is loaded into the search repository rather than when retrieving the data. I'd prefer to be able to customize ordering when retrieving search results so it could be applied to any field.