Forum Discussion

sasrsc's avatar
sasrsc
Copper Contributor
Aug 11, 2020
Solved

Modern Search Web Part specific need to search a list

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... 
https://microsoft-search.github.io/pnp-modern-search/search-parts/search-results/

  • 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:

     

    Search 4 sites (in one results source)

     

3 Replies

  • sasrsc's avatar
    sasrsc
    Copper Contributor

    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:

     

    Search 4 sites (in one results source)

     

    • AngeF76's avatar
      AngeF76
      Copper Contributor

      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)

    • genefrice's avatar
      genefrice
      Copper Contributor

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

       

      Thanks