Search code examples
microsoft-graph-apionedrive

Searching One Drive files using MS Graph not returning results


I observed that when I create a folder in OneDrive and Search for the same in Graph Explorer immediately, an empty collection is returned. Is there any time delay which is expected? Is there any scheduling for indexing of the drive items?

I am searching for the folder- SearchFolder using the query :

/v1.0/me/drive/root/search(q='SearchFolder')?select=name,id,webUrl

If I search for some old folders/documents search is working fine.

Also even after deleting, few items are returned in the search results.

How can we overcome this?


Solution

  • The search API uses a search service under the covers, which requires indexing of content. As a result, there will be some time between creation of an item and when it will appear in search results. What that time is has, to my knowledge, not been documented.