Skip to content

Replace Google autocomplete search form with search-as-you-type

Sarah German requested to merge gps-results-inline into main

What does this MR do and why?

Google's embeddable autocomplete search form did not work reliably with our implementation (details). So, we're jumping ahead of schedule and replacing the Google search form with a search-box-by-type GitLab UI component, which fetches search results as the user types their query.

This MR also addresses some UX issues flagged with the previous component:

Note: Search on the review app might not work temporarily. We're hitting quota limits with our API key; we're working to resolve this here.

Screenshots, screen recordings, or links to review app

Review app: https://gps-results-inline.docs.gitlab-review.app/

Before After
image image
image image

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: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Compile with Google search flags:
make clean && GOOGLE_SEARCH_KEY="AIzaSyAUCkVNs7JsHYKISjVrVv1PGXg9WQr1MCQ" SEARCH_BACKEND="google" bundle exec nanoc compile
  1. Run searches from the homepage and interior content pages.

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.

Edited by Sarah German

Merge request reports