Forum Discussion
Limit SharePoint Search to current Site
Good Morning:
I am looking to create a Knowledge base type of site, where the search only brings results from that KB Site.
Be it using the Pnp Search tools, or the normal search box at the top of the site, how can i limit the search? i tried a few things, but so far, i alway get results from all the sites I am a member.
thank you
Hello MVCuser
when you use the PnP Modern Search Web Parts https://microsoft-search.github.io/pnp-modern-search/ you can define the Path:"" into your query.
Like:
Path:"https://TENANT.sharepoint.com/sites/MSTEvents/"
This query show's only results from the site MSFEvents.
Hope this helps.
Regards, Dave
6 Replies
Hello MVCuser
when you use the PnP Modern Search Web Parts https://microsoft-search.github.io/pnp-modern-search/ you can define the Path:"" into your query.
Like:
Path:"https://TENANT.sharepoint.com/sites/MSTEvents/"
This query show's only results from the site MSFEvents.
Hope this helps.
Regards, Dave
- MVCuserBrass ContributorFantastic thank you David. Do you know when it comes to Filters: i created a column that has some choices. I try to use that as a filter but it is not showing me that column. Do you know what thaat might be (the column is a site column with many choices, i wanted to use those choices as filters)
ThanksHello MVCuser
yes, i think you need to configure managed properties:
https://microsoft-search.github.io/pnp-modern-search/scenarios/set-up-managed-properties/
Please attention, this can takes several hours.
And then you can configure your filters:
https://microsoft-search.github.io/pnp-modern-search/scenarios/page-with-filters/
Happy search 😉
Regards, Dave