-
-
Notifications
You must be signed in to change notification settings - Fork 228
Description
Split from #888 (comment) by @postb99
Hello, since you intend a rework, an additional thought :) Maybe this could better be seen as new issue/wishes?
After reading Lunr documentation I found out that you decided to keep multi-term search to be only "ORed" and this is not my cup of tea but is basically Lunr's one :D but your configuration prevents using it. I would prefer a search that check for presence of every entered term, by design (especially for my site, lol). I would love to have feedback from other users that use the theme.
Secondly, you also prevented wildcard search, but I would like to try it once.
However I'm fully ok with removing tilde (fuzzy search) or caret (negation) because in French caret can be used for linking two words (two search terms then) or building a compound word (that I think would better give several search terms too).
A typical example where I can't find what I look for on my site is "arc-en-ciel" that would be better break into 3 search terms and all of them required for match.
It seems that you removed Lunr stemmers but you see to keep shipping stemmer files. Another thing that would be explained. Did you notice issues when keeping stemmers and your custom boosts?
Theme search page code:
- this removes special chars
hugo-theme-relearn/static/js/search.js
Line 137 in 3a0ae52
term = term.replace( /[*:^~+-]/g, ' ' ); - this removes stemmers?
hugo-theme-relearn/static/js/search.js
Line 33 in 3a0ae52
this.pipeline.remove(lunr.stemmer); - I'm fine with this
hugo-theme-relearn/static/js/search.js
Line 144 in 3a0ae52
function searchPatterns(word) {
Lunr documentation:
- https://lunrjs.com/guides/searching.html#term-presence "OR" search by default, altered with "+" and "-" characters, also fuzzy search with "~".
- https://lunrjs.com/guides/searching.html#wildcards
Cheers
Originally posted by @postb99 in #888 (comment)