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

Rustdoc reduce search rank for deprecated items #98759

Closed
pickfire opened this issue Jul 1, 2022 · 5 comments · Fixed by #107629
Closed

Rustdoc reduce search rank for deprecated items #98759

pickfire opened this issue Jul 1, 2022 · 5 comments · Fixed by #107629
Assignees
Labels
A-rustdoc-search Area: Rustdoc's search feature C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@pickfire
Copy link
Contributor

pickfire commented Jul 1, 2022

When user search radix the non-const which is deprecated rank higher than the non-deprecated version.

image

Would be nice to reduce rank of deprecated items in search, it appears on the first result.

It would be better if the search result show that the item is deprecated in favor of something else, and that something else have a higher ranking.

@rustbot label A-rustdoc-search C-enhancement T-rustdoc

@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2022

Error: Label C can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@rustbot rustbot added A-rustdoc-search Area: Rustdoc's search feature C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 1, 2022
@pitaj
Copy link
Contributor

pitaj commented Feb 3, 2023

@rustbot claim

@pitaj
Copy link
Contributor

pitaj commented Feb 3, 2023

I'd like to move forward on this. Hopefully we can get an FCP started. The prime motivation for this is to improve search results when searching for numeric constants like i32::MIN.

Problem

Currently, when searching for i32::MIN, the deprecated item std::i32::MIN shows up before i32::MIN in the search results, and there is no indication that std::i32::MIN is deprecated until you go to the page for std::i32::MIN:
image

And it's even worse if you search for just MIN, where all of the deprecated std::<num>::MIN items come up above the constants on the number types:
image

Resolution

  • sort deprecated items lower in the search results
  • mark deprecated items as deprecated in search results

i32::MAX shows up above std::i32::MAX and core::i32::MAX
image
If just searching for min, the deprecated results show up far below other things:
image
one page later
image

And, as you can see, the "Deprecation planned" message shows up in the search results. The same is true for fully-deprecated items like mem::uninitialized:
image

For good measure, the radix search from the OP:
image

@pitaj
Copy link
Contributor

pitaj commented Feb 3, 2023

Another example from #107629 (comment):

image

image

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 11, 2023
…=jsha

rustdoc: sort deprecated items lower in search

closes rust-lang#98759

### Screenshots

`i32::MAX` show sup above `std::i32::MAX` and `core::i32::MAX`
![image](https://user-images.githubusercontent.com/803701/216725619-40afb7b0-e984-4a2e-ab5b-a95b24736b0e.png)
If just searching for `min`, the deprecated results show up far below other things:
![image](https://user-images.githubusercontent.com/803701/216725672-e4325d37-9bfe-47eb-a1fe-0e57092aa811.png)
one page later
![image](https://user-images.githubusercontent.com/803701/216725932-cd1c4a42-d527-44fb-a4ab-5a6d243659cc.png)

~~And, as you can see, the "Deprecation planned" message shows up in the search results. The same is true for fully-deprecated items like `mem::uninitialized`:
![image](https://user-images.githubusercontent.com/803701/216726268-1657e77a-563f-45a0-85a7-3a0cf4d66d6f.png)~~

Edit: the deprecation message change was removed from this PR. Only the sorting is changed.
@bors bors closed this as completed in 8596751 Mar 11, 2023
@jsha
Copy link
Contributor

jsha commented Mar 13, 2023

Fixed by #107629.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants