When full indexing is ran, searchRestrictions are getting applied and facet creation is failing. When I use SessionService.executeInLocalView() all the searchRestrictions are disabled.
But my requirement is that I need to disable a particular restriction (not all restrictions) for full indexing context (not to disable/change at DB level). Is there any OOTB method that I can use to achieve this if not what is the best way to achieve this.
You can search the restriction through
and loop over that list to find the one you need. (Or create a new method to fetch a specific search restriction)
Next you can remove that restriction from the session:
To have this only affect for the
SessionService.executeInLocalView()