olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.89k stars 545 forks source link

Feature request #363

Open crystalfp opened 6 years ago

crystalfp commented 6 years ago

To put a trimmer first in the pipeline I have to do:

fullTextIndex = lunr(function() {

    this.use(lunr.multiLanguage("en", "it"));

    this.pipeline.after(this.pipeline._stack[0], MyImprovedTrimmer);
}

The usual this.pipeline.add(MyImprovedTrimmer); works, but put my trimmer at the end of the pipeline.

It could be helpful to have added the function this.pipeline.prepend(func) that puts func first in the pipeline.

olivernn commented 6 years ago

I think this would be a good addition to the pipeline interface, anyone interested in putting together a PR?