I'm using graph (Graph Explorer as well as my custom Azure Application which utilizes Graph API with the appropriate grants of Files.ReadWrite.All, Sites.ReadWrite.All) to search for specific files within a folder in a drive as documented here: https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0&tabs=http.
If I specify as follows it works:
However, if I specify the parent folder's Id, it returns empty or misses files (it seems it misses mostly png, jpg, adobe files):
This is also true when I use the https://graph.microsoft.com/v1.0/search/query endpoint.
If I specify a path, it will not return results.
"queryString": "myfile path:\"https://contoso.sharepoint.com/sites/Library/Shared Documents/PATH\""
But if specify no path, or the Document library level, it will return the image files.
"queryString": "myfile path:\"https://contoso.sharepoint.com/sites/Library/Shared Documents\""
Funny thing is that it usually does actually successfully bring up text or PDF documents, but images like PNG and JPG often get lost. That is confusing to me as well. However if I do the drive root search, those images can be found. Is there a reason why when I specify the parent folder the graph api doesn't work properly? I've given it some time to index, but doesn't seem to change. Any help would be appreciated.
I also noticed that the webUrl on an image file is something like:
but a docx file is
https://contoso.sharepoint.com/sites/LIBRARY/Shared Documents/My Path/myfile.docx
I would appreciate any help on this.