olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Document serializing/loading indices #183

Closed rstacruz closed 9 years ago

rstacruz commented 9 years ago

Is this the correct way to save/load indices? The documentation doesn't say much about this.

var idx = lunr(...)
var data = JSON.stringify(idx)
var idx = lunr.Index.load(JSON.parse(data))
olivernn commented 9 years ago

Yep, thats the right way of loading/serialising. The documentation could be a little clearer on this, I really need to spend some time on writing guides for common things like this.