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 not working properly #1599

Open
LarsFischer97 opened this issue Mar 22, 2022 · 2 comments
Open

Search not working properly #1599

LarsFischer97 opened this issue Mar 22, 2022 · 2 comments

Comments

@LarsFischer97
Copy link

Bug Description
In the slate demo (https://slatedocs.github.io/slate) the search function does not show any chapters unless you write them out completly.

Screenshots
grafik
grafik

Browser
Tested in

  • OS: [Windows & Android]
  • Browser [Chrome, Firefox, Edge]
@LarsFischer97
Copy link
Author

I found the problem.

https://lunrjs.com/guides/searching.html

Just add (+ "*") this in the search function in _search.js

  var results = index.search(searchInput.value + "*").filter(function(r) {
    return r.score > 0.0001;
  });

@SirBernardPhilip
Copy link

I also added the wildcard before the searchInput.value. Also, I believe part of the blame is in the lunr stemmer so you can remove it if your page is not going to be extremely long.

this.pipeline.remove(lunr.stemmer)

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