Fix 'Use GitLab' section search filter

What does this MR do and why?

Adjusts encoding for the search query string. While the search query needs spaces to be converted to plus signs, the search filters should not use this.

Because of this bug, filter values with multiple words (like "Use GitLab") were not matching any content; this was not very apparent because the "User docs" checkbox maps to multiple Docs sections (Use GitLab, Subscribe, Tutorials), and until recently, the site section breadcrumb wasn't shown alongside results.

Filter docs: https://developers.google.com/custom-search/docs/structured_search#filter-by-attribute

This bug was introduced here: !3969 (merged)

Closes #1699 (closed)

Validate

We should check that the "User docs" checkbox filter, which maps to multiple site sections, does indeed show docs from all of those sections.

  1. Visit the review app search page: https://1699-user-search-filter-borkage-gps.docs.gitlab-review.app/search/
  2. Search for something you know is in "Use GitLab," like secrets
  3. Filter the results by "User docs" and verify you see "Use GitLab" links
  4. Search for something in the Subscribe section, like activate premium
  5. Filter the results by "User docs" and verify you see "Subscribe" links
  6. Search for something in the Tutorials section, like git tutorial
  7. Filter the results by "User docs" and verify you see "Tutorial" links

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

Loading