slatedocs / slate

Beautiful static documentation for your API
https://slatedocs.github.io/slate
Apache License 2.0
36.02k stars 112 forks source link

Search not working properly #1599

Open LarsFischer97 opened 2 years ago

LarsFischer97 commented 2 years ago

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

LarsFischer97 commented 2 years ago

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 commented 1 year ago

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)