Rachit
Rachit

Reputation: 403

SearchRestriction not working on Hybris

To test a restriction so that a product code was not visible on the front end site for apparel store (provided OOTB by Hybris), I made a restriction by going to BackOffice->Personalizatiopn and made a new personalization rule by giving the filter as :

{code} = '300392196'

And ApplyOn customerGroup

But still when I go to a site for my extension(mysitestorefront) like :

http://localhost:9001/mysitestorefront/?site=apparel-uk

I am able to search the product in "What You're looking for section".Am I doing some mistake in implementing the restriction?

Upvotes: 0

Views: 1643

Answers (1)

HybrisHelp
HybrisHelp

Reputation: 5810

Personalization apply to the direct flexible search query, but storefront search is based on Solr, it will make a query to Solr. All indexed products can be searched from the storefront. So if you restrict a product to be searched, then stop indexing it.

Which products should be indexed are defined by flexible search queries provided in full and update fields of your indexed type.

Go to HMC/BackOffice > System > Facet Search > Indexed Types > Select your indexed type > There you find full and update queries.

append your where clause (like where {code} != '300392196') to query and do full solr indexing


If you want to hide/show your product to the specific group based on some condition, then you can follow this steps

Upvotes: 2

Related Questions