Filter autocomplete query suggestions by language

Hi,
I enabled autocompleteSuggestions={true} for <SearchBox>, however, I noticed the suggested query items are giving all language items back. I am wondering if it is possible to filter those query suggestions by language? For example, if user select 'fr-CA', it will only give french suggestions?

Hi @Charlie_Fan !

Welcome to the community!

Unfortunately not, autocompleteSuggestions uses the App search suggestions API (Query Suggestions Guide | Elastic App Search Documentation [8.4] | Elastic) which does not support being able to filter.

Another solution, whilst has its own set of challenges, is have an engine per language document set and choose which engine to use based on the customer's language preference. This allow the suggestions API to work as intended.

Joe

1 Like

Dear @joemcelroy ,

Are you aware of any plans making filtering possible? We would also like to use the autosuggest (of App Search), but as there are other restrictions involved on certain fields this is not possible. A normal search would be possible to already sent calls after for example 3 characters, but this bypasses the strength of autosuggest and impacts analytics.

Kind regards,
Sander

1 Like

To my knowledge, adding the ability to filter App Search suggestions is not on our roadmap.

We're experiencing something similar with a multi-tenant implementation of App Search where it looks like we'll be unable to use Suggestions without a way to filter results to individual customers/users. I imagine a filter capability could solve for this as well.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.