AI OnAI Off
Hi William,
I am not sure that you are configuring autocomplete manually or you are using tracking searching history for autocomplete.
If you use tracking then you can add more tag for market id when doing search like this:
SearchClient.Instance.Search<[SearchingContentType]>
(query).Track(new[] {$"marketId:{_currentMarket.GetCurrentMarket().MarketId}"});
Then you can filter search suggestions on market id as same as the way you did with site id and language:
SearchClient.Instance.Statistics().Autocomplete(query, 10, new[] {$"marketId:{_currentMarket.GetCurrentMarket().MarketId}"});
Hope this help!
On a multisite installation running both CMS and Commerce, I am performing the following code to filter search suggestions on site ID and language:
SearchClient.Instance.Statistics().Autocomplete(query, 10, new[] { $"siteid:{SiteDefinition.Current.Id.ToString()}", $"language:{currentCulture.TwoLetterISOLanguageName}" });
However, seeing as some languages have more than one market (e.g. Dutch (nl-NL) for The Netherlands and Belgium) this results in suggestions which are meant for e.g. the (Dutch language) Belgian website are showing up on the Dutch website.
I would like to be able to filter the suggestions on market as well as site ID and language, to enable differing suggestions for (e.g.) nl-NL and nl-BE. Is there any specific method to approach this, or perhaps a workaround to separate autocomplete per market?
Thanks in advance for any help.