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 search ranking regression in 1.82 #133017

Closed
dtolnay opened this issue Nov 13, 2024 · 4 comments · Fixed by #133043
Closed

Rustdoc search ranking regression in 1.82 #133017

dtolnay opened this issue Nov 13, 2024 · 4 comments · Fixed by #133043
Labels
A-rustdoc-search Area: Rustdoc's search feature C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@dtolnay
Copy link
Member

dtolnay commented Nov 13, 2024

Compare these two rankings:

In 1.81, std::io::Write shows up as number 5, after three functions called write in std::{fmt, fs, ptr} and after std::fmt::Write. These results look decent enough to me.

In 1.82, std::io::Write is at number 36, after things like <std::io::Stdout as std::io::Write>::write. I don't think there is any justification for <std::io::Stdout as std::io::Write>::write and std::io::Write::write to outrank std::io::Write when searching for "write".

The most recent nightly continues to be affected (https://doc.rust-lang.org/nightly/std/?search=write).

@dtolnay dtolnay added C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 13, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 13, 2024
@fmease fmease added the A-rustdoc-search Area: Rustdoc's search feature label Nov 14, 2024
@fmease
Copy link
Member

fmease commented Nov 14, 2024

Likely #129430, cc @lolbinarycat @notriddle

@fmease fmease added P-critical Critical priority and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Nov 14, 2024
@fmease
Copy link
Member

fmease commented Nov 14, 2024

Marking P-critical, but feel free to downgrade to P-high.

@fmease
Copy link
Member

fmease commented Nov 14, 2024

I think the high-level solution would be to cease factoring in case-sensitivity when ranking search results if the search string doesn't contain any uppercase letters. Reworded, only if the input string contains some uppercase letters consider case-sensitivity when ranking. I believe I've seen that behavior in other applications. For example, for write the ranking should match the one "of <1.82" but for Write the ranking can match the one "of ≥1.82".

@dtolnay
Copy link
Member Author

dtolnay commented Nov 14, 2024

I agree with that solution. Vim's search behaves this way under the name smartcase. https://vimdoc.sourceforge.net/htmldoc/options.html#'smartcase'

@bors bors closed this as completed in 8912909 Nov 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 15, 2024
Rollup merge of rust-lang#133043 - notriddle:master, r=fmease

rustdoc-search: case-sensitive only when capitals are used

This is the "smartcase" behavior, described by vim and dtolnay.

Fixes rust-lang#133017
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-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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.

3 participants