Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
August 19, 2020 20:26
August 1, 2020 20:15
May 19, 2018 16:11
August 19, 2020 20:29
February 26, 2013 13:19
February 3, 2013 23:43
August 19, 2020 22:11
August 19, 2020 20:29
August 19, 2020 20:29
May 20, 2012 11:48
August 19, 2020 20:29


Join the chat at

Build Status

A bit like Solr, but much smaller and not as bright.


A very simple search index can be created using the following:

var idx = lunr(function () {

    "title": "Twelfth-Night",
    "body": "If music be the food of love, play on: Give me excess of it…",
    "author": "William Shakespeare",
    "id": "1"

Then searching is as simple as:"love")

This returns a list of matching documents with a score of how closely they match the search query as well as any associated metadata about the match:

    "ref": "1",
    "score": 0.3535533905932737,
    "matchData": {
      "metadata": {
        "love": {
          "body": {}

API documentation is available, as well as a full working example.


Lunr.js is a small, full-text search library for use in the browser. It indexes JSON documents and provides a simple search interface for retrieving documents that best match text queries.


For web applications with all their data already sitting in the client, it makes sense to be able to search that data on the client too. It saves adding extra, compacted services on the server. A local search index will be quicker, there is no network overhead, and will remain available and usable even without a network connection.


Simply include the lunr.js source file in the page that you want to use it. Lunr.js is supported in all modern browsers.

Alternatively an npm package is also available npm install lunr.

Browsers that do not support ES5 will require a JavaScript shim for Lunr to work. You can either use Augment.js, ES5-Shim or any library that patches old browsers to provide an ES5 compatible JavaScript environment.


  • Full text search support for 14 languages
  • Boost terms at query time or boost entire documents at index time
  • Scope searches to specific fields
  • Fuzzy term matching with wildcards or edit distance


See the file.