Forum Discussion
RogerCP66
Mar 29, 2024Copper Contributor
SharePoint PnP Modern Search v4 to Display results from a specific folder in a library
Hello,
I am trying to setup PnP search on a site to return results from a specific folder in another site. When I connect the results display, I am able to get the search results working and showing results from the folder I want. I can’t seem to get the related search bar to work.
This is my query on the search results which is returning the correct number of pictures that are in the folder.
{searchTerms}Path:"https://tenant.sharepoint.com/sites/sitename/ libraryname "
(FileType:jpg OR FileType:jpeg OR FileType:png OR FileType:tif)
RootFolder:"foldername"
on page 3 I select Use Input Query text >Dynamic Value> connect to source (PnP - SearchBox)> Pnp Search Box Properties (Search Query)
I then added the search box and under available connections selected connect to source (PnP Search Results Properties selected the library> then the third dropdown for the properties and am presented with 2 options (AvailableFieldsFromResults and AvailableFilters). Either selection does not change the results.
I can always get the results to show up from the correct folder but cannot get the search box to show me any results when I try to refine the search.
Hello RogerCP66
when you wann configure filters, you need to use the Filters WebPart
: https://microsoft-search.github.io/pnp-modern-search/usage/search-filters/
In your use case you need a Results WebPart and a Filter WebPart, connect both together and it would be work.
Maybe this article can help you: https://www.mehr365.com/dokumente-aus-einem-spezifischen-ordner-durchsuchen/
Best, Dave
Hello RogerCP66
when you wann configure filters, you need to use the Filters WebPart
: https://microsoft-search.github.io/pnp-modern-search/usage/search-filters/
In your use case you need a Results WebPart and a Filter WebPart, connect both together and it would be work.
Maybe this article can help you: https://www.mehr365.com/dokumente-aus-einem-spezifischen-ordner-durchsuchen/
Best, Dave
- RogerCP66Copper ContributorNot sure I understand, I dont want to create filters. i want to be able to search using the search box option but it is not working or returning any results. Are you saying I need to have both filters and search configured for the search box to work?
Hello RogerCP66
you can only use a Search Box Web Part and a Results Web Part, Filters are optional.
Best, Dave