Forum Discussion
SharePoint Query Rules for subsite filtering
- Aug 22, 2022
Hello Kipetcoff
in your PrintScreens you use two different search technologies, in the first one you use Microsoft Search, in the last one you use SharePoint Search in classic, you must choose a technology. Here are an article about different Search Technologies: https://docs.microsoft.com/en-us/microsoft-365/community/microsoft-365-search-technologies
I prefer Microsoft Search oder SharePoint Search with PnP Modern Search Web Parts.
Where is your property stored? In documents or in property bag from your subsite?
Filter in Microsoft Search
Here is the way, how you can configure Search Filters in Microsoft Search: https://www.mehr365.com/microsoft-search-filter-in-standard-verticals-hinzufuegen/
Filter in SharePoint Search with PnP Modern Search Web Parts
In this article you can find the configuration for your PnP Modern Search Web Parts: https://microsoft-search.github.io/pnp-modern-search/scenarios/page-with-filters/
In this Blog from JoanneCKlein you see a example how you can set and use properties with the property bag: https://joannecklein.com/2021/09/24/adaptive-scope-retention-policy-a-walk-thru/
I know, a lot information but i hope, this helps. Come back to us when you have more questions.
Have a good day and best regards,
Dave
Hello Kipetcoff
yes, it is. You have two different ways:
1. create a result source with your sites and subsites (with path: parameter)
2. use a query direct in your search results web part like this: {searchTerms} SiteID:<ID>
> with the site collection id in your query you search all contents in your site collection and the subsites
To get the site collection ID, you can use this URL in your browser: https://<tenant>.sharepoint.com/sites/<site-url>/_api/site/id
Regards, Dave