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
, andELASTIC_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 |
---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Configure a local GitLab Docs environment.
- Check out this branch.
- Unset a required Elasticsearch config variable like
unset ELASTIC_INDEX
. In the same terminal, runmake view
. This will use Pagefind for search. - 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.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #388 (closed)
Edited by Hiru Fernando