You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👋 This is probably me something wrong but I couldn't find the answer in the docs. I'm creating multiple indexes and have a creator function for them, like:
exportconstcreateLunrIndex=(records: SearchRecords,type: string)=>{returnlunr(function(){this.field('title');// Adding my custom pluginthis.use(trimmer);
I also wrote a simple trimmer plugin.
exportconsttrimmer=(builder: Builder)=>{consttrimmerFunction=function(token){returntoken.update(function(s){consttrimmed=s.replace(/^[\.,;:()\s]+/,'').replace(/[\.,;:()\s]+$/,'');return`${trimmed}`;});};// Register the pipeline function so the index can be serialisedlunr.Pipeline.registerFunction(trimmerFunction,'trimmerCustom');// Add the pipeline function to both the indexing pipeline and the search pipelinebuilder.pipeline.add(trimmerFunction);builder.searchPipeline.add(trimmerFunction);};
👋 This is probably me something wrong but I couldn't find the answer in the docs. I'm creating multiple indexes and have a creator function for them, like:
I also wrote a simple trimmer plugin.
Then I initialize two indexes:
I would expect that calling
.use
would init the plugin once per index, but instead I get:Is there some way to get around this issue?
The text was updated successfully, but these errors were encountered: