Function loadJSONIndex

Deserializes a JSON index (serialized with JSON.stringify(index)) and instantiates a SearchIndex instance. It should be given the same options originally used when serializing the index.

// If the index was serialized with:
let index = createIndex({ fields: ['title', 'text'] })

addAll(index, documents)

const json = JSON.stringify(index)
// It can later be deserialized like this:
index = loadJSONIndex(json, { fields: ['title', 'text'] })