5
votes

I have been trying to search through my SharePoint site. I am able to get results for a single drive:

xxx.sharepoint.com,xxxxxx-xxxx-xxxx-xxxx-xxxxxx,xxxxx-xxxx-xxxx-xxxx-xxxxxx/drives/xxxxxxxxx/search(q='{content}')

But if I do the same search at drive/root, I don't get any result:

xxx.sharepoint.com,xxxxxx-xxxx-xxxx-xxxx-xxxxxx,xxxxx-xxxx-xxxx-xxxx-xxxxxx/drive/root/search(q='{content}')

We basically want to perform a search across the entire subsite.

1
I'm not able to reproduce this but more importantly, both /drives/{drive-id} and /drive/root addresses a single drive. The only difference being that /drive/root uses the default document library whereas /drives/{drive-id} addresses a specific drive.Marc LaFleur
To clarify, do you want to find all documents that match the search criteria in any document library within a subsite?Brad
Is there any update on this? We are looking for a way to search all document libraries within a subsite.Moth

1 Answers

1
votes

Hey a bit late but I've just discovered you can use the /sites endpoint to retrieve all items in a site by expanding relationships of graph objects. Could you try use:

https://graph.microsoft.com/v1.0/sites/root/sites?$expand=lists($expand=items)

This seems to return all list items in all subsites under the root site. You should hopefully then be able to to filter further by subsite, list, field values etc.