Forum Discussion

IngeborgHawighorst's avatar
Oct 08, 2020
Solved

exclude from site search but allow library search

I have a site with several libraries. One has legacy content, a few others have current content.

 

I want the "Search this site" search to exclude the legacy library, but I also need to be able to navigate to the legacy library and use the "search this library".

 

How do I configure this? When I exclude the legacy library from the search results via "Library Settings > Advanced Settings > Allow items from this document library to appear in search results > No" -- then I don't get any results when I search inside the library.

 

Any ideas? This is for the MODERN experience. Please no suggestions about classic pages.

 

  • MAssarlind's avatar
    MAssarlind
    Occasional Reader

    Do I understand it correctly that with your solution

    1. You can search in the excluded library by standing in the document library and searching.
    2. Documents in the excluded library do no show up when searching via
      a) the search box for the site, nor
      b) the global tenant search box.

    Thanks!

  • Andrew Hodges's avatar
    Andrew Hodges
    Bronze Contributor

    IngeborgHawighorst 

     

    The scenario that you are talking about isn't possible with the settings that you have mentioned as you have found out. 

     

    You want to be able to search the content in the library from the library which means the content has to be indexed. The setting you mention excludes the content from the index. 

     

    Result sources can be modified to exclude content but I haven't found a way to exclude a library only a site.  The only thing I could think of is moving the content to a new site, create a new result source, exclude the new site and make that the default for all sites. 

Resources