Function loadIndex

Instantiates a SearchIndex instance from a JS Object. 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 = index.toJSON()
// It can later be loaded like this:
index = loadJSON(json, { fields: ['title', 'text'] })