Replies: 1 comment 6 replies
-
Hey! The Query Suggestions plugin does accept filters with the const querySuggestionsPlugin = createQuerySuggestionsPlugin({
searchClient,
indexName: 'YOUR_INDEX_NAME',
getSearchParams() {
return {
facetFilters: [
/* YOUR_FILTERS */
],
};
},
}); If you need more advanced customization, you can still override the source's If ever I misunderstood what you were trying to do, you can still reproduce what you currently have in this sandbox and we'll find a way to get there. Hope this helps! |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out how to use the query suggestions plugin in autocomplete for my specific use case.
Issue
The createQuerySuggestionsPlugin returns suggestions which do not provide any results, because the suggestion is based on index items which belong to another website.
Background information
I have a single index which contains all pages/products of two equal websites. In the frontend I'm using a filter in instantsearch to filter out the correct results on a specific key, for example "website1" or "website2".
The query suggestions index is based on the index which contains all pages/products from both websites. Ideally I would be able to pass a filter in here, so I could just create a specific query suggestions index for each individual website. Since that is not possible, is it possible to filter suggestions from the createQuerySuggestionsPlugin? So I can only retrieve suggestions which return results from either website1 or website2? Because the suggestions index itself does not contain the website key that I need to filter on:
I know that it would also make sense to create separate indexes for both websites, but the drawback of that would be that I need to maintain more indexes in Algolia (having to set all configurations in both indexes and I also have a few replicated indexes for sortation purposes).
Beta Was this translation helpful? Give feedback.
All reactions