-
-
Notifications
You must be signed in to change notification settings - Fork 804
Closed
Description
Describe the bug
Empty results when loading precomputed index.
Version
6.4.3
Is this a regression?
dunno
🔬Minimal Reproduction
const Fuse = require('fuse.js');
const fs = require('fs');
const search_options = {
includeScore: true,
useExtendedSearch: true,
keys: ['title']
}
callback = function(err) {
if (err) throw err;
console.log('Write complete');
};
const datasets = [{"title":2},{"title":3}];
var myIndex = Fuse.createIndex(search_options.keys, datasets);
fs.writeFile('./index.json', JSON.stringify(myIndex.toJSON()), callback);
//var myIndex = Fuse.parseIndex('./index.json');
const fuse = new Fuse(datasets, search_options, myIndex);
var search_term = process.argv[2];
var result = fuse.search(search_term);
console.log(result);
console.log(myIndex);
Additional context
The last print shows that docs, keys, records is empty, if loaded from the precomputed index.
Reactions are currently unavailable