Skip to content

Default to Pagefind the search default for local sites

What does this MR do and why?

WHAT

  • This MR adds a fallback to Pagefind for make view command IF any Elasticsearch related variables are not set (ELASTIC_CLOUD_ID, ELASTIC_KEY, and ELASTIC_INDEX).
  • Updates search.md documentation to mention this new behavior.

WHY

  • When technical writers try to run documentation site locally, they will most likely not have the required configuration already set up.
  • It's important to have the fallback search set to "Pagefind" as it requires no set up configs.

Screenshots, screen recordings, or links to review app

Elasticsearch configs are set No Elasticsearch configs are set
es-config-found es-config-missing

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment.
  2. Check out this branch.
  3. Unset a required Elasticsearch config variable like unset ELASTIC_INDEX. In the same terminal, run make view. This will use Pagefind for search.
  4. In a different terminal, run make view (all variables should be set ideally 😄), this will use Elasticsearch for search.

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #388 (closed)

Edited by Hiru Fernando

Merge request reports

Loading