Skip to content

Invalid search filters should warn the user

Created by: mpsenn

Feature request description

As a search user, I'd like to be warned when searching using a filter that doesn't exist. I'd still like Sourcegraph to fallback to searching in literal mode (as it does today), but I'd like to know that my invalid filter won't take effect.

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

I commonly know my desired filename when searching. So I include the file: filter in my searches. However other tools, such as github.com search, name this filter filename:. So when using Sourcegraph, I type filename:banana, which is an invalid filter. Sourcegraph shows me "No results matched your query" because there are no files containing the literal "filename:banana"

Screenshot, showing an invalid filter, and no results. I'd like this to warn me "there_is_no_such_filter" does not exist. Screenshot showing a filter there_is_no_such_filter:banana and no results

Describe alternatives you've considered.

Alternatively, file: and filename: could be aliases.

Additional context

Opened from an internal conversation with redacted customer.