Skip to content
Snippets Groups Projects

Search backend: use sort interface of `result.Matches`

Merged Warren Gifford requested to merge backend-dry-run/cc/deduplicate-sort into main

Created by: camdencheek

We have a built-in sorting mechanism for the result.Matches type, and it was almost equivalent to that of sortResults. This brings the two into agreement and removes sortResults in favor of the sorting interface implemented by result.Matches.

To do this, I needed to:

  • Remove exactFilePatterns logic. This was already unused since exactFilePatterns was always being passed as nil.
  • Add AuthorDate to the Key type and modified the Less() method to use it for sorting. Previously, we were sorting by CommitID, but this is not a very useful sort for commit results.
  • Convert a few uses of []result.Match to result.Matches so we can use the sort interface it implements

Merge request reports

Approval is optional

Merged by avatar (Jul 13, 2025 12:15am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading