Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: support searching by modules #36814

Open
mvdan opened this issue Jan 27, 2020 · 2 comments
Open

x/pkgsite: support searching by modules #36814

mvdan opened this issue Jan 27, 2020 · 2 comments

Comments

@mvdan
Copy link
Member

@mvdan mvdan commented Jan 27, 2020

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:

  1. Make the search work for both packages and modues, allowing to trim it down with selectors like is:module. Think like GitHub search, where you can search for both issues and PRs at once, but then trim it down via is:issue.
  2. Keep the search as it is now, but also add a "module search" page.

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.

@mvdan mvdan added the pkgsite label Jan 27, 2020
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 28, 2020

To consider one more related data point, go4.org is an example of a module that does not have a Go package at the root. Searching for "go4.org" finds many packages in that module:

https://pkg.go.dev/search?q=go4.org

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.

@mvdan
Copy link
Member Author

@mvdan mvdan commented Jan 28, 2020

I don't think the short word is related here - like you said, it's just an example. It's also an exact match for the basename of a module path, so the search shouldn't be particularly tricky at all.

@julieqiu julieqiu changed the title go.dev: searching for modules isn't supported go.dev: support structured search options Jan 28, 2020
@julieqiu julieqiu changed the title go.dev: support structured search options go.dev: support searching by modules Jan 28, 2020
@gopherbot gopherbot added this to the Unreleased milestone Feb 6, 2020
@julieqiu julieqiu changed the title go.dev: support searching by modules x/pkgsite: support searching by modules Jun 15, 2020
@julieqiu julieqiu added the UX label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.