Question

Let's say we have /sites/hub-1 which is a hub site and template is team site. Then we have 2 sites associated to sites/hub-1

  1. /sites/team-1 which is a team site
  2. /sites/comm-1 which is a communication site

Now if I use search api inside /sites/hub-1 like one below I get results from both team-1 and comm-1.

/sites/hub-1/_api/search/query?querytext='something'

But when my /sites/hub-1 is communication site the above search query returns result only from comm-1. No results are returned from team-1

This behaviour has nothing to do with hub sites, rather i observed the same when using search api inside any other communication site as well. It returns results from communication sites only. But when we use same api inside team site it returns results from both team and communication sites.

What is so different is searching from communication site?

Thanks

Était-ce utile?

La solution

You need to add additional property in the query EnableDynamicGroups:true.

By doing this, you will be able to fetch data from Team site. By default, results from private O365 groups is not included.

So, modify your query as below:

/_api/search/query?querytext='something'&Properties='EnableDynamicGroups:true'"

Reference - Retrieving search results from private Groups in Office 365 via REST

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top