使用 Microsoft Graph API 仅按标题搜索 OneDrive 文件

Search OneDrive files by title only with Microsoft Graph APIs

以下代码使用 Microsoft Graph API 搜索 OneDrive。

List<DriveItem> items = graphServiceClient
    .getMe()
    .getDrive()
    .getRoot()
    .getSearch("abc")
    .buildRequest()
    .get().getCurrentPage();

此编码 returns 所有与标题匹配的文件和文件夹(可能还有文档中的内容)"abc"。

如何限制搜索结果只获取与标题匹配的文件 "abc"?

编辑

请在 -

投票支持此功能请求

https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/16855591-microsoft-graph-api-search-onedrive-files-by-titl

目前无法将搜索目标限制为仅标题。此时,您需要对结果进行 client-side 过滤。请在 Office Developer Platform UserVoice 页面打开功能请求。 Link 从这个 post 到它,这样其他人就可以找到并投票。