diff options
author | Sarah German <sgerman@gitlab.com> | 2023-06-15 08:51:16 +0300 |
---|---|---|
committer | Ashraf Khamis <akhamis@gitlab.com> | 2023-06-15 08:51:16 +0300 |
commit | 6db0dde262e2a0c3b62c388fbb5ee00cf66b59b1 (patch) | |
tree | 6575d2de47c5c64ac25104cfa1960e7f12f6b4e8 | |
parent | 5b17f047b24afe90a256d6fdeec83f7f0867e4f5 (diff) |
Adjust encoding for search queries with spaces
-rw-r--r-- | content/frontend/search/components/google_results.vue | 2 | ||||
-rw-r--r-- | content/frontend/services/google_search_api.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/content/frontend/search/components/google_results.vue b/content/frontend/search/components/google_results.vue index 8a5b81ac..0d94b4af 100644 --- a/content/frontend/search/components/google_results.vue +++ b/content/frontend/search/components/google_results.vue @@ -87,7 +87,7 @@ export default { formatSuggestion(suggestion) { // Drop the "+more" and any subsequent text from the correction. // These are filter values, which we include elsewhere. - return suggestion.split('+more').shift().trim().replaceAll('*', ' '); + return suggestion.split('+more').shift().trim().replaceAll('+', ' '); }, async search(query, filters, corrected = false) { this.results = []; diff --git a/content/frontend/services/google_search_api.js b/content/frontend/services/google_search_api.js index d4cc8622..939d30e7 100644 --- a/content/frontend/services/google_search_api.js +++ b/content/frontend/services/google_search_api.js @@ -20,7 +20,7 @@ export const fetchResults = async (query, filters, pageNumber, resultCount) => { new URLSearchParams({ key: GOOGLE_SEARCH_KEY, cx: GPS_ID, - q: `${query}${filterQuery}`.replaceAll(' ', '*'), + q: `${query}${filterQuery}`.replaceAll(' ', '+'), start: (pageNumber - 1) * resultCount + 1, }), ); |