SOLVED

Modern Search Web Part specific need to search a list

Occasional Contributor

Following the recent(ish) release of the PnP Modern Search tools for SP Online I have a specific need... 
On a site page add a search box which will only search a specific list that I have created. 

I can build the search box and the results and I have them connected but by default I think it searches the whole tenant for any potential matches. I want it to search a specific list only for matches. How can I do that... 
re: https://microsoft-search.github.io/pnp-modern-search/search-parts/search-results/

3 Replies
best response confirmed by sasrsc (Occasional Contributor)
Solution

I have able to solve this myself after alot of research...

I have created scenarios where I'm searching a single list and another where I search 4 specific site collections and populate the values using the search verticals after creating 4 different results sources.

I think the support docs could be cleaner for citizen developers and given the use case I would expect to be a considerable number of the folks trying this.

 

Search a specific list:

sasrsc_0-1598310241175.png

 

Search 4 sites (in one results source)

sasrsc_1-1598310322335.png

 

@sasrsc Can you share how you were able to connect the modern search web parts to a list you created yourself?

 

Thanks

@sasrsc  I also need to know how to connect my Search Results Web Part to a SharePoint list (it's currently showing results from our entire company SharePoint site)