Skip to content

resultsmodel: sort by category relevance first only when not the same

Natalie Clarius requested to merge work/natalie/category-type-sort into master

When comparing categories for sorting, go by less-than for category relevance only when the category relevance actually differs, else fall back to match relevance.

Test plan:

  1. Create a plain text file named tomato_sauce.txt
  2. Create a spreadsheet named tomato.ods
  3. Search for "tomato"

Before: Text file is shown first, because plain text files are always shown before spreadsheets, which is not useful

After: Spreadsheet is shown first, as expected, because it is an exact match, and so its category is more relevant

Merge request reports