SharePoint Query Rules for subsite filtering

Occasional 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.


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?



4 Replies
best response confirmed by Kipetcoff (Occasional Contributor)

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:

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:


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:


In this Blog from @Joanne Klein you see a example how you can set and use properties with the property bag:


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,



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><site-url>/_api/site/id


Regards, Dave