slashdotdash / jekyll-lunr-js-search

[UNSUPPORTED] Jekyll + lunr.js = static websites with powerful full-text search using JavaScript
MIT License
549 stars 106 forks source link

Config option to disable the stemmer #77

Open nvenegas opened 9 years ago

nvenegas commented 9 years ago

From https://github.com/olivernn/lunr.js/issues/38 there are some cases in which you want to turn off lunrjs's stemmer (e.g., with it on "onboard" is the stem and "onboardi" fails to match it, but "onboarding" matches that stem).

It would be nice to be able to have a config option to remove the lunr stemmer the indexer's pipeline.

hobzcalvin commented 9 years ago

The given method for removing functions from the pipeline is: index.pipeline.remove(index.stemmer) or this.pipeline.remove(lunr.stemmer) if within the shortcut initializer or to create an empty index and never add the unwanted pipeline functions. A config option would be further redundant.

zephor commented 9 years ago

Unless I'm missing something it seems you have to remove the stemmer from the pipeline before the index is built. Currently the index is built by the jekyll plugin in this file: https://github.com/slashdotdash/jekyll-lunr-js-search/blob/master/lib/jekyll_lunr_js_search/indexer.rb

That means we have no control over removing the stemmer before that point. It seems a config option for configuring the indexer is the only option?