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 has a word/character count limitation? #5968

Closed
4 tasks done
MaximilianKohler opened this issue Sep 4, 2023 · 5 comments
Closed
4 tasks done

Search has a word/character count limitation? #5968

MaximilianKohler opened this issue Sep 4, 2023 · 5 comments

Comments

@MaximilianKohler
Copy link

Context

No response

Description

I'm searching for a phrase/sentence and it gives zero results unless I shorten it.

If I search for "Cariogenic microbiome" it will return results for both cariogenic and microbiome. If I search for Cariogenic microbiome and microbiota of the early primary dentition it will give me tons of results but not ranked in the "most matches" or "best matches" order, so it's useless. If I search for "Cariogenic microbiome and microbiota of the early primary dentition" I get no results.

Related links

Use Cases

I'm just trying to use really basic search operations that work on virtually all other website searches that I'm aware of.

I moved my wiki/site from a github wiki, and haven't found any other SSG that comes close to being a viable replacement. The github search function was working well for everything I needed.

Visuals

No response

Before submitting

@squidfunk
Copy link
Owner

Thanks for suggesting. The search does not have a character count limitation. If you put everything in quotes, every term must occur (see example). The problems you're describing are all related to lunr.js not being the perfect choice when it comes to docs search. As I've already mentioned in multiple issues and discussions, we're currently rebuilding the search and will be solving all of those problems. The new search will return relevant results in a much, much better way.

The github search function was working well for everything I needed.

GitHub has fundamentally changed its search implementation and I agree that it is much better now. Our search implementation will be even more powerful in the future ☺️ Until then, there's no action to be taken on this particular issue, as it's a general suggestion to improve relevance of results. Closing.

@MaximilianKohler
Copy link
Author

MaximilianKohler commented Sep 5, 2023

Thank you Squid! I'm looking forward to the new search!

I tested your link:

https://squidfunk.github.io/mkdocs-material/?q=%22custom+color+schemes%22

And it does work. Then I tried a longer text:

"Material for MkDocs provides the styles for code blocks"

https://squidfunk.github.io/mkdocs-material/?q=%22Material+for+MkDocs+provides+the+styles+for+code+blocks%22

It doesn't work.

I wasn't clear whether you were saying this shouldn't happen The search does not have a character count limitation, or whether you were acknowledging that it is indeed a limitation The problems you're describing are all related to lunr.js not being the perfect choice when it comes to docs search of the current search?

@MaximilianKohler
Copy link
Author

@squidfunk

Were you saying this shouldn't happen The search does not have a character count limitation, or were you acknowledging that it is indeed a limitation The problems you're describing are all related to lunr.js not being the perfect choice when it comes to docs search of the current search?

Because my test above shows a character count limitation.

@squidfunk
Copy link
Owner

squidfunk commented Sep 13, 2023

It's not a character count limitation. I think it is related to using stopwords like "the" and "for" in exact searches.

@squidfunk
Copy link
Owner

squidfunk commented Nov 20, 2023

Please checkout #6372 – the PR attempts to solve the problem that exact phrase and sentences are not conveniently ranked, being preceded by many results that do not contain the terms searched. Your examples from above:

screenshot-localhost-3000-mkdocs-material-reference-1700489393301

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