The only way to exclude content from global/Microsoft Search is to set the no crawl flag which would break your Search API. Unfortunately the capability you're asking for doesn't exist outside of using permission to prevent users from accessing the content.
SharePoint Search hide (not exclude) from global search
Hello, will you please let me know how I can customize to not to display one subsite results in the main SharePoint 2013 global Search? I know that exclude rule will remove all results but I am using Search API to return results for that specific subsite document libraries. Thats why I don't want to stop crawling/indexing content. If I exclude subsite, my custom search API also returns no result.
Please advise
4 answers
Sort by: Most helpful
-
-
Jerryzy 10,586 Reputation points
2021-03-03T08:49:18.227+00:00 Hi @Shri-6058 ,
Agree with trevor's statement, if want to exclude subsite result disappear in the global search, the only way is set in "Search and offline availability"->"Allow this site to appear in search results?" -> No.
But it will also break the search API to return sub site document librarys' results.
Thanks
Best Regards
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Shri-6058 326 Reputation points
2021-03-04T05:11:07.167+00:00 Thank you so much both of you.
What if I go with a custom search box using custom template - someone explained here: https://www.c-sharpcorner.com/article/steps-to-create-custom-display-templates-in-sharepoint-2013/ but not sure if we can hookup the global search with this. -
Shri-6058 326 Reputation points
2021-03-04T23:07:58.67+00:00 Thank you again. So now that I cant do anything from SharePoint configuration/customization side, how about executing Search API impersonating administrator and remove as soon as the query returns result/display? Also, remove everybody's permission for the library to make sure it wont display in global search but ensure crawling/indexing is enabled. I beleieve it should work right?
Thanks
Shri