Trying to figure out how to limit Episerver Find to only index pagefiles under published pages. The problem is that when i pass a empty search string to the search client it redirects me to episervers login page becouse I dont have access to see unpublished pagefiles.
If i comment out the following row from SearchInitialization.cs it works:
but then no pagefiles are indexed...
We are using the solution from Henrik Lindström
The only modifications I have made to it is to verify that this row does not throw an error
var publicationStatus = content.PublishedInLanguage()[softLink.OwnerLanguage.Name];
It did it to for us since we have an upgraded Site Where OwnerLanguage was null.