Searching for "Resource" in Kubernetes buries result
Created by: beyang
Repro:
- I want to find
func Resourcein the Kubernetes codebase. - Go to the Kubernetes repository on Sourcegraph and search for
type:symbol Resource
Result: the top results are all partial matches in a vendored dependency:

I can refine my search by filtering out the vendor/ directory (note: a new user wouldn't know how to do this), but I still get noise:
I try repo:^github\.com/kubernetes/kubernetes$ type:symbol core.Resource -file:vendor and get no results, timing out after 21s:
I try a regex search repo:^github\.com/kubernetes/kubernetes$ type:symbol \bresource\b -file:vendor. There are a lot of matches for "resource", but at least this shows me the whole-world matches.
Each new search is now taking 15-20s to complete for some reason.
I try a text search with a file path filter: repo:^github\.com/kubernetes/kubernetes$ func Resource file:core. This takes 15s, but it gives me what I want:
If I didn't intend to keep trying until I was able to find what I want, I probably would have given up after the 2nd or 3rd search.
Our search query language is super powerful, but it seems to me there are a lot of UX issues that can derail the user along the way. If users can't consistently get to what they want easily inside a few seconds using our product, they're not going to come back to us again and again to find the answers they're looking for.



