Custom sort order to ignore "The" prefix

I’d like to modify the logic used by the _sort query parameter so that it ignores "The " at the start of the field to sort by. As a contrived example, “car”, “limousine”, “the boat” would be sorted as “the boat”, “car”, “limousine”.

Where would be the best place to implement this? The closest I’ve found is in issue #9567, where a global policy is used to apply a sort to all unsorted queries, but I think to use a policy here would result in the result being sorted multiple times (which isn’t the end of the world, but is a bit of unnecessary computation).

1 Like