v0.4.1
Want to migrate? We have prepared a guide to help you migrate from v0.3.
Release highlights
- Extended search - this allows you to put special patterns to further narrow down your search
- We now have two fuzzy algorithms for you.
"v2"(default) gives you better highlighting for matched characters while"v1"compensates that for speed. - You can turn off fuzzy matching to do an exact match on strings instead
- If scores of two matches are tied and you prefer one to appear above the other, you can provide a tiebreaker to do this. The library ships with two of them.
- If matched characters appear at more than one place in the string, you can now choose whether to highlight the characters that appear at the end of the string or the ones that appear at the start. This is controlled by
forward.
Breaking changes
options.cacheis removed. As a result, no caching is performed.options.maxResultItemshas now been renamed tooptions.limitnormalizeis now on by default. This means we'll automatically remove diacritics/accents from Caffè to make it Caffe for example. This can be toggled off inoptions.forwardis now on by default. This means earlier querying "abc" on "xabc yabc" used to highlight last occurrence (abc of yabc). Now first occurence (abc of xabc) will be highlighted instead. This can be toggled off inoptions.positionsis now a Set. Earlier it could either be an array or a null.- Result item is now flattened. This means
entry.result.scorewill now be written asentry.score. Same applies forstartandend.
Fixes
- The package now correctly resolves as ESM in Node.js environments