Using pre-built lunr indexes


I've implemented pre-built indexes vs. on demand i.e. generating them when the search page is being loaded. I'm not entirely happy with the solution yet for the following reasons:

One novel approach to solving both these problems is to utilise a V8 crate and run lunr index natively. This is the approach adopted by the lunr indexer for middleman (a static site generate written in ruby).

Since we're not looking at native Cobalt solutions i.e. using liquid templates, another approach would be to modify the node.js script used to pre-build the index, to parse the content natively and remove the need for the lunr.liquid template. The script would also need to generate the documents collection that's still used by the search page minus the content field.

The code changes can be found in the following commits:



Tweet