Skip to content

Commit

Permalink
feat(search-pro): improve suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Apr 5, 2024
1 parent 5ab421f commit 7cfa7fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/search-pro/src/client/worker/suggestion.ts
Expand Up @@ -13,7 +13,10 @@ export const getSuggestions = (
fuzzy: 0.2,
maxFuzzy: 3,
...searchOptions,
});
}).map(({ suggestion }) => suggestion);

return suggestions.map(({ suggestion }) => suggestion);
// filter multi-word suggestions if query is not multi-word
return query.includes(" ")
? suggestions
: suggestions.filter((suggestion) => !suggestion.includes(" "));
};

0 comments on commit 7cfa7fb

Please sign in to comment.