If the string we want to match appears after position 70, in another string which is longer than 70 chars, it won't match it.
Not sure before this, but happens on 6.0.0 up to 6.2.1.
const assert = require('assert')
const Fuse = require('fuse.js');
const list = [
{
title: 'The Lock Artist',
author: {
name: 'Steve Hamilton',
tags: [
{
value: 'The readable English, Many desktop publishing packages and web juliancito'
}
]
}
}
];
const options = {
includeScore: true,
keys: [ 'author.tags.value' ]
};
const fuse = new Fuse(list, options);
const result = fuse.search('juliancito');
assert(result.length > 0)
Not a bug 馃槃
Please check out the scoring theory.
Since you didn't specify the fuzzy-matching options, Fuse.js will use the following values:
location defaults to 0distance defaults to 100threshold defaults to 0.6With the above options, for something to be considered a match, it would have to be within (threshold) 0.6 x (distance) 100 = 60 characters away from the expected location 0.
Since 70 > 60, it obviously wouldn't match.
Strongly encourage everyone to read the scoring theory for additional insights.
Thank you for the insight.
Will read. Much appreciated.