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: package search doesn't find main package with matching name #70459

Closed
ComaVN opened this issue Nov 20, 2024 · 9 comments · Fixed by ComaVN/multee#12
Closed

x/pkgsite: package search doesn't find main package with matching name #70459

ComaVN opened this issue Nov 20, 2024 · 9 comments · Fixed by ComaVN/multee#12
Assignees
Labels
pkgsite/search Issues related to pkg.go.dev search functionality pkgsite

Comments

@ComaVN
Copy link

ComaVN commented Nov 20, 2024

What is the URL of the page with the issue?

https://pkg.go.dev/search?q=multee

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Screenshot

image

What did you do?

I published my package multee.

What did you see happen?

pkg.go.dev doesn't show the main package when searching for "multee", but a sub-package (an alternative implementation that I kept around for benchmarking and testing)

What did you expect to see?

I expect to see the search results show the main package, not a "random" sub package.

@ComaVN ComaVN added the pkgsite label Nov 20, 2024
@gopherbot gopherbot added this to the Unreleased milestone Nov 20, 2024
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@ComaVN
Copy link
Author

ComaVN commented Nov 20, 2024

Some context: in the v0.0.1 version, the sub-package with the alt implementation was also named multee, which I fixed in v0.0.3

If I search for the module in a different way, eg. "multiplexer for io.Readers", it does show the main package.

@adonovan
Copy link
Member

@jba

@jba jba self-assigned this Nov 20, 2024
@seankhliao seankhliao changed the title x/pkgsite: package search finding the wrong subpackage x/pkgsite: package search doesn't find main package with matching name Nov 20, 2024
@seankhliao seankhliao added the pkgsite/search Issues related to pkg.go.dev search functionality label Nov 20, 2024
@findleyr
Copy link
Member

Interestingly, a search for "ComaVN/multee" does return the package:
https://pkg.go.dev/search?q=ComaVN%2Fmultee&m=package

Threfore, this does look like a pkgsite bug (not just poor search ranking, which we have various other problems with).

@findleyr findleyr modified the milestones: Unreleased, pkgsite/backlog Dec 12, 2024
@ComaVN
Copy link
Author

ComaVN commented Jan 15, 2025

If this cannot be easily fixed, would it be at least possible to remove/unpublish my package, so I can add it again, without the confusingly named /alt packages? I think that would fix it as well, no?

@jba
Copy link
Contributor

jba commented Jan 27, 2025

Here is why pkgsite shows the subpackage instead of the main one when you search for "multee":

  1. Both have the same number of importers, so popularity doesn't affect the ranking.
  2. The subpackage actually uses the word "multee" in its synopsis, while the main one doesn't (and both paths contain "multee" once).

So I think the search algorithm is working as intended. We deliberately don't have any rule that prefers "higher-up" or shorter import paths to longer ones, because there is no reason why the shorter path should be more popular than the longer one.

In other words, there is no way for pkgsite to know that what you call the main package is really the important one.

The best way to solve your problem is to get users. Presumably a lot more people will use the main package, and this increased popularity will push it to the top of the list.

ComaVN added a commit to ComaVN/multee that referenced this issue Jan 27, 2025
@ComaVN
Copy link
Author

ComaVN commented Jan 28, 2025

FYI @jba I released v0.0.4 where I addressed (some of) your points, but there still seems to be an oddness to the search result: following the link above, https://pkg.go.dev/search?q=multee, still shows the "wrong" package @v0.0.3, but if I then switch to "Symbols" and back to "Packages" the correct package and version is shown.

(It changes the url to https://pkg.go.dev/search?limit=25&m=package&q=multee, so it's probably some cache that needs to time out. I tried using a different browser in in-cognito mode as well).

I'll check in a few days, and if it doesn't go away, I'll request a package removal, and re-publish it.

@jba
Copy link
Contributor

jba commented Jan 28, 2025

I think it was caching. I just tried the search and I got the v0.0.4 main package.

@ComaVN
Copy link
Author

ComaVN commented Jan 28, 2025

Same, thanks for your trouble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkgsite/search Issues related to pkg.go.dev search functionality pkgsite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants