0

DriveItem Search does not seem to be possible in an Office 365 group context, despite the documentation mentioning it should be supported: GET /groups/{group-id}/drive/root/search(q='{search-text}')

Steps to reproduce (e.g. in the Graph Explorer):

  1. create newFileTest.docx in the root of your GROUP folder
  2. Search for the file: https://graph.microsoft.com/v1.0/groups/{GROUP_ID}/drive/root/search(q='newFileTest.docx') - returns 0 items
  3. create newFileTest.docx in the root of your PERSONAL folder;
  4. Search for the file: https://graph.microsoft.com/v1.0/me/drive/items/root/search(q='newFileTest.docx') - returns 1 item

Happy to provide more info if needed.

Dennis Ameling
  • 707
  • 7
  • 15

3 Answers3

0

I've tried the following (with my O365 group):

https://graph.microsoft.com/v1.0/groups/cfb5e170-36b0-4156-b17b-4b6bc2ddd777/drive/items/root/search(q='t.xlsx')

and it's returning one (as it should).

enter image description here

vhr
  • 1,528
  • 1
  • 13
  • 21
0

this is most probably due to insufficient permission. You may not have Read Write Permission for Groups.

You can try this .

Pallav
  • 145
  • 7
0

Thanks for taking the time to reply everyone! Turns out the problem is with one of my sites that I'm trying to perform a search in. Searching in the SharePoint UI also doesn't work on this site, and it's not visible in the list of Team Sites in OneDrive. A different Team Site is visible in this list, and searching in that Site works in both the SharePoint UI and Graph API. Will open a support ticket with Microsoft about this. Thanks again!

The affected Team Site: search not working

The working Team Site: search working

Dennis Ameling
  • 707
  • 7
  • 15