cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Solr search autocomplete and auto suggestions

0 Likes
3,312

Hi experts,

I need to display product types according to connected user, I define a Listener to add the filter query

that work fine for the PLP but I still get all the products in the text and autocomplete search. Any idea?

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Likes

Hi, Hybris brings suggestions from SOLR & it doesn't filters suggestion based upon on filter query (fq parameter in search query).

SOLR 6.3+ version added feature called context filtering. It will help to filter out suggestion based upon context field mentioned in the configuration & context query at query time. The AnalyzingInfixLookupFactory and BlendedInfixLookupFactory currently support this feature, when backed by DocumentDictionaryFactory. This will requires update solrconfig.xml for suggester component & add parameter (suggest.cfq=filter term) at query time . Follow SOLR documention for more information https://lucene.apache.org/solr/guide/6_6/suggester.html

Alternate approach for older version : Use facet based suggestion, Send search query along with required filter, and required facet parameters (e.g facet.field=autosuggest, facet.prefix={Search term}.)