A Python implementation of Lunr.js
Maintained. Last release 4 weeks ago, commits in 1 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install lunrLunr.py
A Python implementation of Lunr.js by Oliver Nightingale.
A bit like Solr, but much smaller and not as bright.
This Python version of Lunr.js aims to bring the simple and powerful full text search capabilities into Python guaranteeing results as close as the original implementation as possible.
What does this even do?
Lunr is a simple full text search solution for situations where deploying a full scale solution like Elasticsearch isn't possible, viable or you're simply prototyping. Lunr parses a set of documents and creates an inverted index for quick full text searches in the same way other more complicated solution.
The trade-off is that Lunr keeps the inverted index in memory and requires you to recreate or read the index at the start of your application.
Interoperability with Lunr.js
A core objective of Lunr.py is to provide interoperability with the JavaScript version.
An example can be found in the MkDocs documentation library. MkDocs produces a set of documents from the pages of the documentation and uses Lunr.js in the frontend to power its built-in searching engine. This set of documents is in the form of a JSON file which needs to be fetched and parsed by Lunr.js to create the inverted index at startup of your application.