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: group search by module #47320

Closed
jba opened this issue Jul 21, 2021 · 7 comments
Closed

x/pkgsite: group search by module #47320

jba opened this issue Jul 21, 2021 · 7 comments
Labels
FeatureRequest FrozenDueToAge pkgsite/search Issues related to pkg.go.dev search functionality pkgsite

Comments

@jba
Copy link
Contributor

jba commented Jul 21, 2021

Currently, each result on the search page displays one package, and multiple packages from the same module are displayed as separate results. We plan to change that. Although each result will still display a single package—the highest-scoring one for its module—we will group other packages from that module together in the same result. For example, say module M has 100 packages, p1, p2 ..., p100, with p1 ranked highest. Currently search will show 100 results for M, one for each package. After this change, it will show one result, M/p1, with an indication that there are 99 other packages in module M.

We will also group versions of a module, showing the latest version and grouping the rest.

@gopherbot
Copy link

Change https://golang.org/cl/336950 mentions this issue: internal/postgres: repeat search when grouping

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jul 23, 2021
When grouping results, search a second time with a larger limit if the
first doesn't return enough results.

Also, remove the Limit search option; it is an implementation detail
that should be determined by DB.Search.

I tested this against 176 distinct queries obtained from the logs over
a 1-hour period, with max results = 10. Although it was somewhat
slower than without grouping, the 99%ile was still under 1 second.

For golang/go#47320

Change-Id: Ie09d6b83bc270a7113abd74b03daf26fa6054b0f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/336950
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/341178 mentions this issue: internal/frontend,static: use singular nouns for search modes

@gopherbot
Copy link

Change https://golang.org/cl/341310 mentions this issue: static/frontend/search: update header style on hover

@gopherbot
Copy link

Change https://golang.org/cl/341174 mentions this issue: static/frontend/search: bold metadata

@gopherbot
Copy link

Change https://golang.org/cl/341176 mentions this issue: internal/frontend: support search mode prefixes

@gopherbot
Copy link

Change https://golang.org/cl/341449 mentions this issue: internal,static/frontend: update other major versions style

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 11, 2021
When a search query contains a "package: " or "identifier: " prefix,
always default to that search mode, regardless of the `m=<mode>` query
param that is set.

For golang/go#47320
For golang/go#44142

Change-Id: I412772fe264e25a3cb79362eaa4ba992fe273beb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341176
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 11, 2021
The search modes are changed to the singular "package" and "identifier".
The constant values are also added to basePage, to ensure that the same
string is used throughout the templates and Go code.

For golang/go#47320
For golang/go#44142

Change-Id: Ia82f81b64fb267f4fe352359c0276426a69ebdaa
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341178
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 11, 2021
When a user hovers over "Search instead for: ...", all of the text will
turn blue.

For golang/go#47320
For golang/go#44142

Change-Id: I4d4c405b006abe63b92e8bee480f43233fbe33e5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341310
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 11, 2021
The other major versions snippet is updated based on mocks:
https://gallery.googleplex.com/files/c46280fcc23b4aae99948b265e5c07d0:

* "Other module versions" is changed to "Other major versions"
* The link is displayed as a regular link instead of a chip
* This snippet is placed above "Other packages in this module" if both
  are present

For golang/go#47320

Change-Id: I50fc522de97c773b9fc1bc72bd3cd395f7d2bc7f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341449
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 11, 2021
Bold num imported by, version, and commit time based on mocks at
https://gallery.googleplex.com/files/c46280fcc23b4aae99948b265e5c07d0

For golang/go#47320

Change-Id: Ic98a7ea797d86481174090b22af77b8b9aad3478
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341174
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
@jba jba closed this as completed Aug 18, 2021
@julieqiu
Copy link
Member

Reposted from #47321 (comment)

These features are live on https://beta.pkg.go.dev! 🎉

Give it a try, and please file an issue for any feedback.

@hyangah hyangah added the pkgsite/search Issues related to pkg.go.dev search functionality label May 20, 2022
@rsc rsc unassigned jba Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge pkgsite/search Issues related to pkg.go.dev search functionality pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants