Disable Search Restriction in Hybris
import de.hybris.platform.search.restriction.SearchRestrictionService;
Define attributes
private SessionService sessionService; private SearchRestrictionService searchRestrictionService;
Create getter & setters for the above services.
Here I am trying to disable the search restriction for category related query
Collection = getSessionService().executeInLocalView(new SessionExecutionBody() {
@Override
public Collection execute() {
try {
getSearchRestrictionService().disableSearchRestrictions();
return getCategoryDao().findCategoriesByCode(code);
}
finally {
getSearchRestrictionService().enableSearchRestrictions();
}
}
});
Define attributes
private SessionService sessionService; private SearchRestrictionService searchRestrictionService;
Create getter & setters for the above services.
Here I am trying to disable the search restriction for category related query
Comments