Forum Discussion

enotgl480's avatar
enotgl480
Copper Contributor
Aug 26, 2024

Modifying Sharepoint online modern search bar on site level to return results from library

Hi all,

 

I'm working on trying to modify search results on site level to only return files from a specific library. The original Documents library setup had obsolete, initial, approved, and published document folders. I moved the published document folder to its own library. This was done so that I could turn off search for the Documents library and only enable the Published Document library to return results on the site level. The problem now is that when a user goes to any folder level within the Document Library, they are not able to perform any searches because search is turned off. I'm thinking about turning the search back on for Documents library but need to find another way to filter results on the site level. Please let me know if there is a better way of doing this.

  • Hello enotgl480 

     

    that's correct, when the search on a library are disabled, you can't find any information in every search.

     

    You can move the documents in a folder with no permissions for users, or you can use the PnP Modern Search WebParts https://microsoft-search.github.io/pnp-modern-search/ to configure a custom search page only with results you want e.g. filter properties, content types or others.

     

    Best, Dave

Resources