Page MenuHomePhabricator

Option to sort alphabetically in Search API
Closed, DuplicatePublicFeature

Description

Hi! I was surprised to find out that it's not possible to sort search results alphabetically with the Search API. Sorting alphabetically is quite often what you want when using the Search API to generate lists of pages that match certain criteria, for example for a report. I'm sure there're other queries that would benefit from it.

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Feature Request".
EBernhardson subscribed.

I suspect the underlying technology is now sufficient to support alphabetical sorts (although we would have to evaluate it to be sure). The main sticking point in Cirrus today is going to be that the way we define keyword fields does not allow doc_values to be enabled. We would need to migrate all the existing fields with the keyword tokenizer to instead use the keyword type along with normalizers, which then allows us to enable doc_values on appropriate keyword fields. Once the index mapping is in place the new sort is only a few lines of configuration in Cirrus.

Merging into T40403 as there is already more context there.