There are two ways to use lunr to index some documents, The simplest way is to just build the index client side each time the page is loaded. search.js
shows an example of this.
If your data is relatively static it might be more efficient to generate the index server side and then load this on each page load, your can see an example of generating the index in node in builder.js
.
You can load a serialised index like this:
var idx = lunr.Index.load(JSON.parse(json_string))