slate
slate copied to clipboard
Search not working properly
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
Browser Tested in
- OS: [Windows & Android]
- Browser [Chrome, Firefox, Edge]
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;
});
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)