How Graph API can be used to search on HUBSites altogether.

Ankur 1 Reputation point
2022-12-06T08:41:19.803+00:00

Suppose there are 10 hubsites associated to a single hub , how graph api can search on all hubsites altogether.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | Development | Microsoft 365 Publishing
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2022-12-07T02:10:07.793+00:00

    Hi @Ankur
    Per my research, there is no such api can reach your requirement in graph. As a workaround, I would recommend you to use rest api to list all sites which is either a hub site or associated with a hub site. Please refer to following url

    Query: contentclass=sts_site  
    Refinement filter: departmentid:string("{*",linguistics=off)  
    Trim duplicates: false  
    REST: /_api/search/query?querytext='contentclass%3dsts_site'&refinementfilters='departmentid:string("{*"%2clinguistics%3doff)'&trimduplicates=false  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.



Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.