nightlytrails nightlytrails - 1 month ago 18
Java Question

Search OneDrive files by title only with Microsoft Graph APIs

The below code searches OneDrive using Microsoft Graph APIs.

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


This codes returns all files and folders that matches the title (and probably content also as per the documentation) "abc".

How can I restrict search results to fetch only the files that matched the title "abc"?

Edit

Please vote for this feature request at-

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

Answer

There currently isn't a way to restrict the search target to just the title at this point. At this time, you'll need to perform client-side filtering of the results. Please open a feature request at the Office Developer Platform UserVoice page. Link to it from this post so other people can find and up vote it.

Comments