Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/pkgsite: support searching by modules #36814
The current search functionality works on packages alone. That's fine, and useful - but quite limited in the module world.
For example, when I visit https://pkg.go.dev/search?q=sh, I'd expect to see https://pkg.go.dev/mod/mvdan.cc/sh/v3. Particularly since the query string is an exact match with the basename of the module path.
However, because it happens to not be a Go package, it doesn't show up at all as neither a module nor a package. A few sub-packages show up later, but they are scattered, and aren't nearly as useful.
I see two ways this could be addressed:
I think 1 is far better, since most people will just use the default search page, leaving out many of their potentially useful results hidden away.
To consider one more related data point,
Perhaps a part of the problem affecting the case described in the original issue is that "sh" is a short word, and so it's hard to use it to find specific results reliability.