From 9c0c3e8cbd078f5fc963fb33dfbd8af2eb27fbd3 Mon Sep 17 00:00:00 2001 From: Shinsina <46794001+Shinsina@users.noreply.github.com> Date: Thu, 20 Apr 2023 17:30:27 -0500 Subject: [PATCH] Update search.js --- packages/marko-web-search/loaders/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/marko-web-search/loaders/search.js b/packages/marko-web-search/loaders/search.js index 242f2985b..3054d6bff 100644 --- a/packages/marko-web-search/loaders/search.js +++ b/packages/marko-web-search/loaders/search.js @@ -64,7 +64,7 @@ module.exports = async ({ apolloBaseCMS, apolloBaseBrowse } = {}, { queryFragment, opSuffix, - enableNewSearch = false, + useAutocomplete = false, } = {}) => { if (!apolloBaseCMS || !apolloBaseBrowse) throw new Error('Both the BaseCMS and Base Browse Apollo clients must be provided.'); const input = { @@ -72,8 +72,8 @@ module.exports = async ({ apolloBaseCMS, apolloBaseBrowse } = {}, { statuses: ['PUBLISHED'], contentTypes, countryCodes, - ...(!enableNewSearch && searchQuery && { search: { query: searchQuery } }), - ...(enableNewSearch && searchQuery && { autocomplete: { phrase: searchQuery } }), + ...(!useAutocomplete && searchQuery && { search: { query: searchQuery } }), + ...(useAutocomplete && searchQuery && { autocomplete: { phrase: searchQuery } }), ...((assignedToWebsiteSiteIds.length || assignedToWebsiteSectionIds.length) && { assignedToWebsites: { ...(assignedToWebsiteSiteIds.length && { siteIds: assignedToWebsiteSiteIds }),