尽管documentation提到它应该得到支持,但是在Office 365组上下文中似乎不可能进行DriveItem搜索:qazxswpoi
重现的步骤(例如在Graph Explorer中):
GET /groups/{group-id}/drive/root/search(q='{search-text}')
newFileTest.docx
- 返回0项https://graph.microsoft.com/v1.0/groups/{GROUP_ID}/drive/root/search(q='newFileTest.docx')
;newFileTest.docx
- 返回1项如果需要,很高兴提供更多信息。
我尝试了以下(与我的O365小组):
https://graph.microsoft.com/v1.0/me/drive/items/root/search(q='newFileTest.docx')
它正在返回一个(应该如此)。
https://graph.microsoft.com/v1.0/groups/cfb5e170-36b0-4156-b17b-4b6bc2ddd777/drive/items/root/search(q='t.xlsx')
感谢您抽出宝贵时间回复大家!事实证明问题在于我正在尝试执行搜索的某个网站。在SharePoint UI中搜索也无法在此网站上运行,并且在OneDrive的“团队网站”列表中不可见。此列表中显示不同的“团队网站”,并且在该网站中搜索可在SharePoint UI和Graph API中使用。将与微软就这一点开启支持票。再次感谢!
受影响的团队网站:this