Hey Folks,
Welcome to this series on the PnP Search Results web part – it is one of the most powerful tools in the SharePoint Framework ecosystem. Whether you’re a beginner or experienced developer, this series will guide you step-by-step towards getting better hands-on PnP Search Result Solutions.
Now let’s learn about PnP Modern Search Results basics.
What is the PnP modern search results web part?
The PnP Search Results web part is the part of PnP Modern Search solutions. It is built using the SharePoint Framework (SPFx). It allows developers to create highly customizable and dynamic search results solutions in SharePoint.
It gives you a fill control over how search queries are executed and how results can be displayed using templates, filters, and layouts. You can also create your own layouts via the Search Extensibility which we will cover later in this series.
Now, the second thought that should come to your mind is why we don’t use the default SharePoint search.
Why do we not use the default SharePoint Search?
SharePoint default search provides the built-in search capabilities. It comes with several limitations. Those limitations are defined below.
The PnP Search Results web part solves the above problems by offering flexibility, extensibility and a developer-friendly approach to building search-based solutions.
What are the Key Features & Capabilities of PnP Search Results?
Now we will perform a practical for adding PnP Search Results web part to our SharePoint Site.
Before we perform practically, we need the prerequisites below.
First, we need to download PnP Modern Search Results package from PnP’s Official site or GitHub repository
![image 1]()
Download package from here.
![image 2]()
![image 3]()
Now, once you add that PnP Search Result web part in page it will ask you to configure like in image
![image 8]()
Click on Configure button and it will open the Property Pane.
In Property Pane Select SharePoint Search as a Data source.
Now, selecting SharePoint Search as a Data source it will not show any data; to fetch data we need to add query to fetch data.
So, we will see a simple use of Query Template and filters for this.
In Property Pane add “*” to Query Template as shown in image below and click on Apply.
![image 4]()
On Apply Click you will be able to see that it will fetch all the data from SharePoint Site.
It contains all the files like docx, ppt, pdf, etc...
But what if we want to fetch only docx files?
To fetch only docx file add a filter query like below and click on Apply.
![image 5]()
Once you hit the Apply button it will filter the data and will only show the docx files.
There are many other configuration options available, but in this series, we will focus mainly on developer-related aspects and practical use cases.
Now, we have seen basic use of Query Template and Filter. Now we will see some default layouts for showing data in different layouts.
Click on next page in Property Pane.
![image 6]()
On the second page, you will find the Available Layouts section, where you can choose how your data should be displayed based on your requirements.
![image 7]()
There are adaptive cards as well which we can use.
In Handlebar/HTML and Adaptive cards, we can use custom designs as per your requirements by injecting the HTML or Json in Custom layout.
If we want a more complex UI, then we can use Search Extensibility as well as which we will see later in this series.
What you Learned?
What is Next?
In Part 2 of this series, we’ll explore:
Conclusion
This article covers the basic fundamentals of the PnP Search Results web part, including its features, setup, and basic configuration. In the next part, we will explore what Handlebar is how it can be used and by using handlebar/HTML how we can create custom layouts.