Aug 19 2022 03:59 AM
Hi, All.
I have parent site and several subsites. The task is to filter documents based on the documents name and specific subsite tag. For example searching from parent site gives this result now.
If I put "cat"(this is project1 tag) it should show only documents from Project 1 subsite.
I tried to set up Query Rules like this, but it doesn't work.
Is it possible and how it must be configured?
Aug 22 2022 03:52 AM
SolutionHello @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 @Joanne Klein 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
Aug 23 2022 10:59 AM
Aug 23 2022 11:41 AM
Aug 24 2022 02:29 AM
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