Upgrading

The 2.x versions of Lunr have a similar interface to previous versions and therefore upgrading shouldn’t require large changes in how searches are performed. There are differences in how indexes are built and serialised, and the interface required of pipeline functions. This guide will cover the major differences and show how to upgrade.

Index Building

The largest difference between 0.x/1.x and 2.x is that Lunr indexes are now immutable. Once they have been built, it is not possible to add, update or remove any documents in the index. All documents must have been added before the definition function exits.