Forum Discussion
Search fields / search query in a list and webpart
- Aug 04, 2022
Thanks a lot,
This is exactly what I was looking for. I still have to get started with the tool to be able to configure the search in a very specific list.
thanks again
Hello EiC4733
you can use a SharePoint Search Box to search a list. It's my preferred solution to configure a custom search page for this case. For SahrePoint Online you can use the PnP Modern Search WebParts: https://microsoft-search.github.io/pnp-modern-search/scenarios/
For classic, it's a WebPart, SharePoint Search Box, available.
Or with this guide you can create your search box:
https://www.codesigned.com/blog/how-to-create-a-custom-sharepoint-search-box-jquery
Regards, Dave
- EiC4733Aug 04, 2022Brass ContributorGiven my skills and my bad English, could you provide me more details on how to configure pnp search to fix the search in a specific library or list and not in the whole site?
- DaveMehr365Aug 05, 2022MVP
Hello EiC4733
add a new search page with a Search Results Web Part: https://microsoft-search.github.io/pnp-modern-search/scenarios/create-simple-search-page/
When you edit the Results Web Part, you can configure the query unter Query Template (page 1 in Web Part configuration). Your Query looks like this:
{searchTerms} path:https://<TENANT>.sharepoint.com/sites/DocumentStore/TechContent/ IsContainer<>true
path: is the direct path to your library
IsContainer<> exclude folders, when you don't have folders, you can delete the parameter IsCointainer<>true
On page 3 in your Result Web Part, you can connect to an Search Box, when you use both.
Hope this helps.
Regards, Dave
**When you like my work, mark as best answer and give a like to the answer
- EiC4733Aug 04, 2022Brass Contributor
Thanks a lot,
This is exactly what I was looking for. I still have to get started with the tool to be able to configure the search in a very specific list.
thanks again