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
It is possible, but probably poorly documented. The feature was requested a long time ago, but I only added it very recently. There is a simple example in the tests that might help.
The tokeniser function must split an object (probably a string, but it should handle other object types in some way also) into strings. You can look at the default tokeniser for some inspiration.
Once you have defined your tokeniser you must associate it with the index, like so:
varmyCustomTokeniser=function(){/* implementation goes here */}lunr.tokenizer.registerFunction(fn,'myCustomTokeniser')// allow the index to be serialised// when creating the indexvaridx=lunr(function(){this.tokenizer(myCustomTokenizer)})
Alternatively the default tokeniser allows you to change what it considers white space to split on, if that is all you need to change.
Hi,
Maybe it's dumb question but I couldn't realize how to add custom tokenizer to lunr, is it possible? Where can I find more advanced examples?
Thank you for great library.
The text was updated successfully, but these errors were encountered: