Tuesday, 2 December 2025

How to Build out a Basic PnP Search Page

 This requires PnP Search Web Parts for SharePoint



  1. Create a SharePoint Page and call it "Search"
  2. Add a "One Column" panel for the Search Box
  3. Add the "PnP - Search Box" Web Part
  4. Create a "One-third right" panel
  5. In the left section, add the "PnP - Search Results" Web Part
  6. In the right section, add the "PnP - Search Filters" Web Part


Search Results
  1. On the "PnP - Search Results" Web Part, set the data source to SharePoint
  2. Change the Query template to the Document Library you want to search. This can be mutiple places, but for todays example it will just be one.
    1. {searchTerms} - This connects it to the Search Box
    2. Path: https://{root site url}/sites/{my site}/{document library}
  3. Click "Apply"
  4. If you have custom field, you must make sure they are selected in  "Selected properties"
    1. I have: "RefinableString01" which I have mapped to a "Division" field in my Document Library
  5. Leave all the rest of the default setting for "page 1" and go to "page 2" of the properties
  6. Set the layout as "List"

  7. Leave all the rest of the default setting and go to "page 3"
  8. For "Use input query text", turn on
    1. Set it to "Dynamic value"
    2. Connect to Source = PnP Search Box
    3. PnP - Search Box's proterties = "Search query"
    4. Use a default value = Off
  9. For "Connect to filter Web Part", turn on
    1. Use filter from this component = Refinable Filters - {Unique GUID}

  10. Leave all the rest of the default setting
Search Filter
  1. Use data from these Web Parts = Search Results - {Unique GUID}
  2. Under "Filter settings"
    1. Click "Edit" for Customize filters
    2. Filters:
      1. Created Date - Created
      2. Created By - CreatedBy
      3. File Type - FileType
      4. Division - RefinableString01

    3. Click "Save"
  3. Leave all the rest of the default setting
Save the whole page