question

ReneWagner-1403 avatar image
0 Votes"
ReneWagner-1403 asked ReneWagner-1403 commented

How to limit searches for content to specific site collections that have the same Property Bag Value?

We have a large number of team/project and department site collections. When the sites are provisioned each site is assigned a Team, Project, and/or Dept value in the site property bag. In some cases there may be multiple site collections that are associated with the same Team and/or Project, and so they would all have the same Team or Project property bag value. In addition, each department may have multiple Team or Project sites associated with it (similar to the Hub Site concept in SP Online, but this is SP on-prem).

We would like to define result sources for searching across multiple Team and/or Project sites, where the query would only search those Team or Project sites that have similar property bag values, so that users don't always get results from across all sites that they might have access to. I.e. we want to be able to run a search that says:

Show me all documents from all sites where property bag value "SiteTeam = Team1" or "SiteProject = Project2".

We have set up a result source that gets the current site's property bag value (e.g. SiteTeam) using the {Site.<Property>} query variable (PropBagTeam:{Site.SiteTeam} ). This query returns the expected list of sites we want to search. Unfortunately this query returns a list of sites and not a list of documents on those sites.

Is there a way to to build a query that returns documents from the list of sites that meet the criteria of the property bag value that is desired? Everything I have found for restricting the sites to search mentions using the Path variable for each site that is desired, but that requires hardcoding paths ... and this is a very dynamic scenario where the paths are different, depending on the site on which the query is run.

Does this make sense? Anyone have any ideas how to build a result source that will return documents from only the desired sites, instead of results from the full index?

Thanks

office-sharepoint-server-search-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ReneWagner-1403,

I am currently looking into this issue and will give you an update as soon as possible.

Thank you for your understanding and support.

0 Votes 0 ·

1 Answer

JoyZ avatar image
0 Votes"
JoyZ answered ReneWagner-1403 commented

@ReneWagner-1403,

Per my test, the property bag of the site in search result source will only return the site, not contents in the site.

In other words, if the site meets this property, the site will be displayed in the search results, however the documents in the site do not have attributes like SiteTeam, so we cannot meet both requirements at the same time.

That's why we could not search all documents based on dynamic site property that are satisfied.


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Julie,

Thanks for the response, but I think you misunderstood what I was asking (or maybe I wasn't clear). What I am trying to do is create a query that will:

  • Get the property bag value from the site from which the query is run

  • Use the property bag value to identify any OTHER sites that have the same value (so put a scope around which sites to search)

  • And then return the documents stored in libraries on those OTHER sites

Is there no way to limit the scope of a query to a specific set of sites this way? Is the only way to use the PATH property on documents to limit the sites to search on (which I can't do in this case because I wont' know ahead of time what those paths are going to be in every case).

Thanks

0 Votes 0 ·
JoyZ avatar image JoyZ ReneWagner-1403 ·

@ReneWagner-1403,

Per my test, this is the property that we get and use it in search query, and it could find the site with related value.

117431-image.png

Then I try to add STS_ListItem_DocumentLibrary to return all document library items in related site, nothing searched.

117406-image.png
So we cannot dynamically limit the scope with the site property.

117389-image.png

If this is not feasible for you, please feel free to reply.


0 Votes 0 ·
image.png (24.4 KiB)
image.png (28.0 KiB)
image.png (48.0 KiB)

Thank you Julie for the detailed response. While it is not the answer I was looking (hoping) for, that does answer my question.

0 Votes 0 ·