Compare each affected Search hit with a direct GET driveItem request; if the direct response contains the correct 64-bit size while /search/query returns the value modulo 2^32, report it as a Microsoft Search service defect and do not use the indexed Size property for filtering files above 4 GiB.
Why the values wrap
Your examples follow an exact unsigned 32-bit wraparound:
-
5 GiB = 5,368,709,120bytes → reported as1,073,741,824bytes -
6 GiB = 6,442,450,944bytes → reported as2,147,483,648bytes - Difference:
4,294,967,296bytes, exactly2^32
That is strong evidence that the Search representation of Size is being truncated or converted through a 32-bit numeric value. Microsoft’s documented Search limitations do not list a 4-GiB file-size boundary ^1^, and SharePoint’s published search limits likewise do not document such a limit for the Size managed property ^2^.
This establishes a likely overflow defect, but not whether it occurs while indexing, evaluating KQL, serializing the Search response, or parsing it in your client.
Isolate Search from driveItem metadata
Take the driveId and item ID from an affected Search hit, then request the item directly:
GET https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}?$select=id,name,size
Authorization: Bearer {token}
client-request-id: {new-guid}
The direct endpoint retrieves the item’s metadata and returns a driveItem; it requires at least delegated Files.Read, or Files.Read.All for application access ^3^. size is a documented property of that resource ^4^.
Compare the raw JSON, before SDK or application deserialization:
- Run your existing
/search/queryrequest and save the raw response. - Run the direct request above for the same item.
- Compare:
- Search
size - Search
fileTotalSize - Direct
driveItem.size
- Search
- Repeat with files just below and above
4,294,967,296bytes.
Interpret the result as follows:
- Direct size correct; Search size wrapped: the problem is in the Microsoft Search/index response path.
- Both raw responses correct; application value wrapped: change the client model to a 64-bit integer, such as C#
long, Javalong, or JavaScriptnumber/BigIntas appropriate. - Both raw responses wrapped: provide both requests to Microsoft Support because the issue is not isolated to Search.
Microsoft Search officially supports returning OneDrive and SharePoint files as driveItem results and supports KQL property restrictions only where the managed property is valid and queryable ^5^. Therefore, changing >= syntax or sorting direction is unlikely to correct an indexed value that has already wrapped.
Workaround
There is no documented query expression that reconstructs the original value after a 2^32 truncation. Until Microsoft fixes or confirms the behavior:
- Do not rely on
Size>=4294967296or Search sorting bySize. - Retrieve candidate items and validate each one with
GET /drives/{drive-id}/items/{item-id}?$select=id,name,size. - If every file must be evaluated, enumerate the drive hierarchy and follow pagination, then filter on the direct
driveItem.sizevalues. Search alone cannot reliably identify all affected files because a file between 4 and 5 GiB can wrap to a value below 1 GiB.
Report the defect
Send a unique client-request-id with each reproduction and retain the response request-id and Date headers. Microsoft specifically requests these values for diagnosing Graph failures ^6^.
Include:
- Tenant cloud/region, without posting tenant identifiers publicly.
- Exact UTC timestamp.
- Raw Search and direct-driveItem requests and responses.
-
client-request-id, responserequest-id, andDate. - Expected and actual byte values.
- A minimal set of test files immediately below and above
2^32. - Confirmation that the same behavior occurs outside your SDK, such as with Graph Explorer or another raw HTTP client.
References
- Use the Microsoft Search API to query data
- Search limits for SharePoint
- Get driveItem - Microsoft Graph v1.0 | Microsoft Learn
- driveItem resource type - Microsoft Graph v1.0 | Microsoft Learn
- Use the Microsoft Search API to search OneDrive and SharePoint content
- How to debug Microsoft Graph API calls