SOLVED

SharePoint Query Rules for subsite filtering

Copper Contributor

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.

Kipetcoff_0-1660906036134.png

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.

Kipetcoff_1-1660906418687.pngKipetcoff_2-1660906485662.png

Kipetcoff_3-1660906605419.png

 

Is it possible and how it must be configured?

 

 

4 Replies
best response confirmed by Kipetcoff (Copper Contributor)
Solution

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 @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 

Thank you for your recommendations. I will compare different approaches, I think it will be old-fashioned classic technology.
Is it possible to use classic approach with Query Rules? Is it possible to search that way files from parent sides inside subsides?

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
 

1 best response

Accepted Solutions
best response confirmed by Kipetcoff (Copper Contributor)
Solution

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 @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 

View solution in original post