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

Search doesn't find substrings of section names #2077

Closed
osresearch opened this issue Apr 20, 2020 · 2 comments
Closed

Search doesn't find substrings of section names #2077

osresearch opened this issue Apr 20, 2020 · 2 comments

Comments

@osresearch
Copy link

image

In this test case I've almost completely typed the section name and search hasn't returned any results yet.

image
Once the final character is typed it finds all of the sections (although it isn't clear which pages, reported in #2076). I would have expected that as soon as "other" was input it would have returned some results, since there is whitespace separating them (as discussed in #1704).

Test case is using mkdocs 1.1 and has three files:

% cat docs/notitle1.md
This is page 1 with no title.

## Other stuff

Keyword
% cat docs/notitle2.md
This is page 2 with no title.

## Other stuff

Keyword
% cat docs/withtitle.md
# Titled Page

This page has a title element `#`.

## Other stuff

Keyword
@waylan
Copy link
Member

waylan commented Apr 20, 2020

Yes, this is an unfortunate behavior of lunr.js. I'm not crazy about it myself, but don't have the time to fiddle with the options to get something which is sort-of better. As I understand it, the Material theme has provided their own implementation which provides a better experience here. However, it is still limited by lunr.js. Really, the best solution would be to go help lunr.js move forward with a better solution in some future new version. Or perhaps find a different lib which provides a better fit.

My time is limited, so if anyone wants this to move forward, then they will need to volunteer to work on it.

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Apr 17, 2024

This could probably be implemented, but nowadays (2024) lunr.js is unmaintained (last commit 2020). While we welcome enhancements to existing themes, we're also discussing creating a new, better default theme, which would probably use something else than lunr.js. This is by the way already supported in Material for MkDocs, as mentioned by @waylan. @squidfunk also stated that he and his team are working on a standalone search plugin that is theme-agnostic and will bring such functionality, see the discussion starting here #3560 (comment).

For these reasons, we'll close this as not planned! If someone wants to work on this anyway, we can re-open the issue.

@pawamoy pawamoy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@pawamoy pawamoy added the Search label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants