Provide alternative for Αlgolia search for air-gapped environments
From the discussion in &693 (comment 276094908), it became apparent that air-gapped installations are to be taken into consideration for the /help
removal epic.
We currently use Algolia in production, and that needs an internet connection, since it connects with their servers to provide the search results.
We might need to come up with an alternative for the cases where the docs are to be used in an air-gapped environment where no internet access is allowed.
Approach
We set up a demo of Lunr.js and investigated indexing strategies in this demo MR. Lunr looks like a good choice for offline search.
Next steps:
-
Refine the demo script to create the Lunr index (!3022 (merged)) -
Add a variable for designating the search backend (Algolia or Lunr) for a site instance that is visible to Nanoc on compile (!3022 (merged)) -
Add logic to templates to render the chosen search backend, and add a frontend for Lunr that looks/behaves similarly to Algolia -
Conditionally include Lunr in Docker images (issue: #1255 (closed))
Research
Offline search engines
Search engines, might not all fit in our case:
-
https://github.com/olivernn/lunr.js
- GitHub uses
lunr.js
for air-gapped environments. Relevant commit that added lunr. - Script the updates the indexes https://github.com/github/docs/blob/fb2aa91ca1dd9f7b60a63ce556edff292b24a811/script/search/sync.js
- GitHub action that runs the script https://github.com/github/docs/blob/d35e99dddd7f345d0a550d29f5324b42ac7b7b63/.github/workflows/sync-search-indices.yml
- Where
lunr
is mentioned https://github.com/github/docs/search?q=lunr
- GitHub uses
- http://elasticlunr.com/
- https://github.com/tinysearch/tinysearch
- https://github.com/nextapps-de/flexsearch
Articles:
Cons of an offline search
The index can be of significant size, for example https://github.com/olivernn/lunr.js/issues/268.