olivernn/lunr.js — pull request #14 by olivernn (2013-03-13 09:40:46+00:00)
Title: Serialise

This branch includes early support for dumping and loading an index, the internals may change but the interface is likely to remain the same, this branch will be released as v0.3.0. I haven't had a chance to update the docs, I'll probably get around to releasing this properly in a week or so.

The index now supports serialisation via `JSON.stringify`. A dumped index can then be reloaded via `lunr.Index.load`.

I have updated the example, in `/example`, to use a pre-built index. The load time is significantly faster! I've also included a simple node script for pre-building the index. I imagine that something similar could be extracted into a standalone tool, but that is for another day.

Any feedback is welcome.