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 results: List exact alias matches before fuzzy ones #82132

Closed
ojeda opened this issue Feb 15, 2021 · 3 comments
Closed

[rustdoc] Search results: List exact alias matches before fuzzy ones #82132

ojeda opened this issue Feb 15, 2021 · 3 comments
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

@ojeda
Copy link
Contributor

ojeda commented Feb 15, 2021

Aliases should be displayed after non-aliases. Since we have fuzzy search [*], we could match in this order:

  • Exact matches (non-aliases)
  • Exact matches (aliases)
  • Fuzzy search (any, assuming it sorts by some "similarity" index)

If we get #82000, then we could even do:

  • Exact matches (non-aliases)
  • Exact matches (Rust aliases)
  • Exact matches (non-Rust aliases)
  • Fuzzy search (any, assuming it sorts by some "similarity" index)

[*]
image

@ojeda
Copy link
Contributor Author

ojeda commented Feb 16, 2021

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

@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 Feb 16, 2021
@lolbinarycat
Copy link
Contributor

triage: it's not clear what the current and desired behavior is. also unable to reproduce the list of results shown in the screenshot.

@ojeda
Copy link
Contributor Author

ojeda commented Nov 6, 2024

The behavior seems to have changed since then, so the screenshot does not apply anymore.

The linked PR was not merged, so the only thing that may still apply is the first list.

Now, for the first list, it looks harder to reproduce, since we get less fuzzy search results nowadays, apparently. But I tried writeln, and I got the exact match first, and then the "fuzzy" ones (removing and even then adding characters) afterwards (e.g. write, write_all).

So it looks like it now works as this issue asked for (at least for that sample), which is great.

Thus closing -- thanks!

@ojeda ojeda closed this as completed Nov 6, 2024
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

No branches or pull requests

4 participants