The Lunr module provides integration between Lunr.js and Drupal.
Using the Lunr module lets you use full text search without bootstrapping Drupal or using Solr. This makes it a great solution for static Drupal sites, or Drupal sites that want to use client site search for performance reasons.
The search page provided by Lunr supports paging, location history, and lazy-loading search results.
Feature highlights
- JavaScript web workers are used for loading pre-compiled indexes and searching.
- Views integration allows for complex data transformations and use cases.
- No-configuration multilingual support for all installed languages.
- Custom field/facet searches can be done through the form or URL via query parameters.
- Lunr field boost is configurable through the UI.
- Settings normally split by index/page/server are consolidated in one simple form and entity.
Installation
Lunr depends on the Serialization and Views modules, which are both in core.
Use
Lunr uses Views to pre-build a search index and pages of search results, which are delivered as needed to clients using JS.
If the Node module is enabled before Lunr, a default Lunr search entity will be created. In this case, you can start using Lunr right away by visiting /admin/config/lunr_search/default/index
, clicking "Index", then visiting the search page at /search
.
You can also index on the command line using an included Node script. See README.txt for more details.
To create a new Lunr search page from scratch, see https://www.drupal.org/docs/8/modules/lunr-search/creating-a-lunr-search...
Deployment
To use Lunr with a static Drupal site, include the public://lunr_search
directory in your deployment.
If you're using Tome, these files are automatically included!
Security
The permission required to access search pages is "access content", and the static JSON generated by this module is implicitly accessible to anonymous users. With that in mind, ensure that only content you want to be made public is indexed.
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Content Editing Experience, Decoupled, Developer Tools
- Ecosystem: Tome
- 31 sites report using this module
- Created by samuel.mortenson on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 8.x-1.x-dev updated 3 Dec 2023 at 17:23 UTC