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!
PnP Modern Search Github Repository - Releases
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
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:
- Select the toggle button for Use input query text
- Select Dynamic Value
- Set Connect to Source to Pnp - Search Box
- Set Pnp Search Box's properties to Search Query
- Select the toggle button for Connect to a filters Web Part
- Choose the Search Filters Web Part
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.
- Set the Use data from these Web parts to the Search Results webpart.
- In Filters settings, Click Edit and set the following: Display name: Video Category, Filter field: RefinableString, Template: Check box, Expand by: Checked, Multi values: Checked, Operator between values: Or, Sort values by: Name, Sort direction: Ascending
- Click Save
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!
Comments