SharePoint Search hide (not exclude) from global search

Shri-6058 326 Reputation points
2021-03-02T16:46:13.14+00:00

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

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2021-03-02T22:44:33.057+00:00

    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.

    0 comments No comments

  2. ZhengyuGuo 10,586 Reputation points Moderator
    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.

    0 comments No comments

  3. 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.


  4. 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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.