If prefLabel was used for sorting, unexpected bahaviors may were happening. This was happening because of the type of the prefLabel field which is of type "text" (or text_en in multilanguage setups).

This was causing an issue because this type is tokenizing the string value. In Solr, tokenized value are known to create unexpected sorting behavior.

To fix this issue, when prefLabel are requested to be sorted, we do the sort against the preflabelAutoicompletion field which is of type "lowercase" that doesn't tokenize the literal.