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

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,216 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,606 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,798 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Trevor Seward 11,681 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. Jerryzy 10,566 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.

    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