0

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

  • 1
    You also need to add EnableDynamicGroups:true in your api as /_api/search/query?querytext='something'&Properties='EnableDynamicGroups:true'"; – Gautam Sheth Aug 1 at 11:29
  • @GautamSheth - This worked. Thanks. – Kunal Valecha Aug 1 at 12:16
  • Awesome, have posted it as answer. You can upvote and accept it as answer, it will help other users in the community. – Gautam Sheth Aug 1 at 13:07
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.