Issue with OneDrive Search Functionality for Partial Matches

石川 敦己 45 Reputation points
2024-06-14T16:13:10.48+00:00

I performed a file search within OneDrive using the search method for drive resources.

I attempted to search for a file named "共有テスト". While I am able to retrieve results when using search queries such as "共", "テスト", or "共有テスト", the search does not return any results when I use "共有".

Could you please explain the cause of this issue and also suggest any alternative solutions, such as using the Microsoft Search API?

Best regards.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 2,335 Reputation points Microsoft Vendor
    2024-06-17T07:53:04.59+00:00

    Hi @石川 敦己

    According to the Graph API, you can query all OneDrive files using the $filter query parameter to retrieve files named "共有テスト".

    The query request is as follows:

    https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=startswith(name,'共')
    

    Here are my test results.

    Screenshot 2024-06-17 154943

    For more details, see the link below:

    https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http

    https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.