Reputation: 2662
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-
Upvotes: 1
Views: 862
Reputation: 3465
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.
Upvotes: 2