I am developing a Add-In for Sharepoint. The App-web for the add-in contains a document library where I store some data.
I want to stop the items in this document library appearing in the results of the share point search when a user is searching from the host web. However I still want to be able to search the contents of the document library programmatically.
What I have tried
I tried turning off the "Allow items from this document library to appear in search results?" option in the settings of the document library (Document Library>>Settings>Advance>>), however when I did that, I couldn’t even search the library programmatically.
Does anyone know a way to hide the items from Sharepoint search results in the host web while being able to get results programmatically?