-
-
Notifications
You must be signed in to change notification settings - Fork 804
Closed
Labels
Description
Same as #524. Copying over from there with slight tweaks.
Describe the bug
Empty results when loading precomputed index.
Version
6.5.3
Is this a regression?
don't know
🔬Minimal Reproduction
const Fuse = require('fuse.js');
const fs = require('fs');
const datasets = [{"title":2},{"title":3}];
const options = {
keys: ['title']
};
var myIndex = Fuse.createIndex(options.keys, datasets);
fs.writeFileSync('./index.json', JSON.stringify(myIndex.toJSON()));
const fuse = new Fuse(datasets, 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