There should be documentation for the serialized structure of the index, so that it may be generated by other programs not written in Javascript.
This can be very useful in static site generators that can pre-generate the search index exactly once, simply to be consumed by Fuse on every page load.
Describe the solution you'd like
We already have this form of JSON serialization:
// Create the Fuse index
const myIndex = Fuse.createIndex(['title', 'author.firstName'], books)
// Serialize and save it
fs.writeFile('fuse-index.json', JSON.stringify(myIndex.toJSON()))
The JSON structure itself doesn't seem to be documented anywhere though.
Describe alternatives you've considered
For a workaround right now, we can call node in a subprocess to keep using Fuse during the generation.
But this requires node, the Fuse package and other things.
Description
There should be documentation for the serialized structure of the index, so that it may be generated by other programs not written in Javascript. This can be very useful in static site generators that can pre-generate the search index exactly once, simply to be consumed by
Fuse
on every page load.Describe the solution you'd like
We already have this form of JSON serialization:
The JSON structure itself doesn't seem to be documented anywhere though.
Describe alternatives you've considered
For a workaround right now, we can call
node
in a subprocess to keep usingFuse
during the generation. But this requiresnode
, theFuse
package and other things.