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

Partial word search only works it we search the start of the word, not the end #1704

Closed
NicolasMassart opened this issue Dec 17, 2018 · 3 comments

Comments

@NicolasMassart
Copy link

Hi, here's my setup:

Issue : when using the search box, if we look for pages containing the word "eth_sendRawTransaction" by searching "eth_send" it will find results however, if we search with "RawTransaction" no result is displayed even if we have pages with words containing this substring.

Expected behaviour: any part of a word may be used as a search string even if the start or end is missing.

Current behaviour: we can only search word either by the exact word or by a substring containing the beginning of the searched word.

Thanks for your help.
Nicolas.

@martinbira
Copy link

Not sure that this issue is directly related to MkDocs but rather Lunr.js or Material for MkDocs.

@waylan
Copy link
Member

waylan commented Dec 17, 2018

MkDocs uses Lunr.js for search. By Default, Lunr.js defaults to using whitespace and hyphens as word separators, however, you can customize that behavior by setting the plugins.search.separator config setting. For example, to use the underscore as an additional separator:

plugins:
    - search:
        separator: '[\s\-\_]+'

However, be aware that the Material theme reimplements much of the search plugin itself and may behave differently as explained in its documentation. For example, it appears to use the extra.search.tokenizer setting to define word separators.

Given the above, you should probably report any search issues with the Material Theme, to the Material theme project. I'm closing this as an upstream issue.

@waylan waylan closed this as completed Dec 17, 2018
@NicolasMassart
Copy link
Author

Thanks. I will do that.

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

3 participants