0
votes

Usecase

Our Solr index contains documents of many countries. Some documents should be only visible in some countries. Thus suggestions provided to a user in the USA should only contain documents visible in the USA.

Approaches to solving the problem

a) When I'm using the Solr SpellCheckComponent for suggestions, I can activate collate=true. This will filter the suggestions to all provided Solr filter queries. http://localhost:8983/solr/collection1/suggest?fq=country:us&q=pro

b) But I want to use advanced suggesters, such as AnalyzingInfixSuggester, so I have to use the Solr SuggestComonent. Unfortunately I can't find a way to activate collate. Thus my filter queries are ignored for the suggestions, and all products for all countries are returned.

Questions

a) Is there a way, to activate collate in SuggestComponent?

b) Or is it possible to use advanced suggesters with the SpellCheckComponent?

1

1 Answers

1
votes

you are looking for Context Filtering. That feature is what you use to filter some suggestions with the advanced suggesters.

Add this row to the suggester configuration:

<str name="contextField">country</str>

Add the request parameter to the suggest query:

suggest.cfq=us