[Google Search] Set up basic search forms
Set up search form components and wire them up to Google search.
Steps:
-
Set up a sandbox account on Google Cloud Platform (https://about.gitlab.com/handbook/infrastructure-standards/realms/sandbox/) -
Enable Custom Search API and create a scoped API key -
Add markup and configuration to use Google for search on the site (similar conditionals to Algolia vs Lunr -- Google should only be used in the GitLab production environment, not self-hosted installs or archived versions) -
Extend the existing Lunr forms to be able to use Google. -
Show results and result count on the /search
page.
This work should be deployable/mergable without impacting the existing Algolia search.
Done when:
- Using an environment variable, we can create a build that uses Google instead of Algolia and run this in a review app or locally.
- We can enter a search query in basic search forms on the site and see results delivered from Google on a dedicated results page (no autocomplete, no modals for now).
- A search without results returns a "no results" message.
- Human-friendly error if we are unable to reach the Google API.
- Results page shows result count ("showing x-y of z results"), and we can see the first ten results (pagination comes later: #1376 (closed))
Edited by Sarah German