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

[BUG] Search takes me to a very sub-optimal place #96

Open
TomOlson opened this issue Oct 28, 2024 · 3 comments
Open

[BUG] Search takes me to a very sub-optimal place #96

TomOlson opened this issue Oct 28, 2024 · 3 comments

Comments

@TomOlson
Copy link

Describe the bug
Searching for a string (in this case "IEEE") in the specification does not take me anywhere near where the string actually occurs in the specification.

Steps to reproduce the behavior:

  1. Go to the spec introduction
  2. Type "IEEE" in the search box
  3. The suggestion list that comes up shows two hits, with snippets of text
  4. Clicking either of them takes you to the start of the chapter containing the selected hit, which may be a very long scroll away from where the hit occurs

Expected behavior
I expected to be taken to the place where the suggested hit occurs in the spec - or at least to the lowest level subsection rather than the chapter. So far, it appears that I can get to the hit using the browser's HTML search, but that requires typing the search string twice.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome 130.0.6723.70, FireFox 131.0.3
@oddhack
Copy link
Collaborator

oddhack commented Nov 1, 2024

The lunr-based search plugin we use is not great, but I'm surprised - normally it navigates you to the section containing the term, rather than the top of the page. There is another search engine which might be better, but suffers from being a commercial product and using some sort of cloud hosting of the search database. We can take this under advisement but it's the sort of thing that probably should be outsourced - if I start poking at antora-lunr internals I'll spend quite a long time getting up to speed on what the heck is going on, mostly we just treat the search engine as a black box. This applies to your other search issue about multiple terms, as well.

@TomOlson
Copy link
Author

TomOlson commented Nov 4, 2024

@oddhack thanks. I take it you observed the same behavior? Per report I see it in Firefox and Chrome, and I've just verified that Safari 17.6 does the same thing.

Incidentally, Safari renders the docs site oddly - there is no left sidebar, and the right sidebar appears at the top of the center column rather than at right where it belongs. I'll open a separate ticket if I get around to it... But key point for this issue, the search behavior (or more precisely, the places the search items take you to) seems to be identical.

@oddhack
Copy link
Collaborator

oddhack commented Nov 5, 2024

I can see in the searchbox results that it's not adding a section anchor to those searches, though no clue why not.

Re the Safari rendering, are you using a window the same size as other browsers? The Antora CSS adapts to size and if you run it on a phone, or in a sufficiently narrow window on desktop, the left sidebar gets collapsed into a menu and the right sidebar is put at the top of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants