Customize Search in SharePoint - p2 - Add the Pnp Modern Search Webparts!
If you have not already, please take a look at
SharePoint Administrator Permissions Required beyond this point!
Microsoft Search is located at the top of the SharePoint page. This is the default search, and as pointed out in the comments it can be customized provided you have the proper permissions, this is at the global level.
Let's explore one way of how we can provide a custom search experience at the site level.
Step 1 -
From the Github Releases repo, download and install the PnP Modern Search v4 solution web parts!
Download the .sppkg package from the latest release!
At this time the latest is PnP Modern Search - 4.14.0
Step 2 -
In the SharePoint Admin Center, upload the .sppkg package and install!
Under Apps
Click the Open button.
Upload the PnP Modern Search .sppkg package
Enable the App and go through each of the Approvals in the next page. When you are finished approving, please go to Step 3.
SharePoint Contributor Permissions is all that is required from this point!
Step 3 -
Setup the search webparts on a SharePoint Modern Page!
In your SharePoint instance, if you have not already, create a new Site Page!
Customize your new Site page by hovering your mouse cursor over the different sections of the page.
I chose to create a main section and a One-Third section
In the PnP Search section Click the Grey + button and search for PnP
Add the PnP Search Box webpart
In the PnP Filters section add the Pnp - Search Filters webpart
Recommended by LinkedIn
In the PnP Search Results section add the PnP Search Results webpart
Step 4 -
Configure the PnP search webparts!
Starting with the PnP Results webpart, click the Configure button or the Edit properties button.
Select SharePoint from Available data sources.
In the Query template let's setup our searchTerms, we want to search from our Video Document library not the entire site.
{searchTerms}
path:"https://[PATH TO YOUR DOCUMENT LIBRARY]"
Replace [PATH TO YOUR DOCUMENT LIBRARY] with the actual url of your library.
Next in Selected Properties, find and select the RefinableString you mapped to the Crawled property.
We need to connect our Search Box with our Search Results
In the properties panel of the Search Results webpart.
Go to tab 3:
We setup a connection from the Search Results webpart to the the Search Filters webpart, now we need to do the same thing from the Search Filters webpart side.
In the properties panel of the Search Filters webpart.
Edit Filters should look similar to this:
Our page should now be complete
Now you should be able to search on a video topic and apply filters!
Thank you for your time!
My video about creating a Video Library in SharePoint
My video demoing adding search to a SharePoint page.
Microsoft M365 MVP, Senior Solution Architect at Fellowmind Denmark, Maintainer of the PnP Modern search project, " If your Information Architecture is lacking, forget all about a good Search or Copilot experience"
4moThanks for sharing knowledge about PnP Modern Search, but I would like to point out that you CAN modify the default search ( actually named Microsoft search, not SharePoint search) You can to a certain level modify that search experience on the site collection level if you are a Site Collection Admin. If you want to tweak the search on the Organization level, you will have to have the Search and Intelligent admin role.