Skip to content

Rank symbol searches before partial matches when using type:symbol filter

Created by: mike-r-mclaughlin

Feature request description

When using type:symbol, exact matches of the symbol name entered should show up before partial matches.

Is your feature request related to a problem? If so, please describe.

Feedback from user:

My use case was I copy and pasted a type name from a stack trace because I wanted to read the file in a repo that I didn't have checked out locally. In general, I think it's important to show exact matches to types/files first for a couple of reasons.

  • Lookup of a known type is a very common use case
  • Showing the exact match first is always expected and never a bad surprise for the user. On the rare occasion when its the wrong choice for the user, there is normally just one or a few results to skip over so search ranking failure is cheap for the user.
  • The opposite situation where the exact match is buried in a sea of other results is much worse for the user, where its like finding a needle in a hay stack

Describe alternatives you've considered.

N/A

Additional context

Requested by: https://github.com/sourcegraph/accounts/issues/6716 via Slack

/cc @benvenker @lguychard