Microsoft Search Graph API returning missing results when using the 'from' property

Matthew Sammut Spiteri 65 Reputation points
2024-06-18T10:56:27.6233333+00:00

Overview

I am facing an issue when using Microsoft Graph Search API (https://graph.microsoft.com/v1.0/search/query) sometimes there are missing results in the page or none at all. The entitytype I'm searching is listItem. This should match SharePoint items, but in reality we are getting missing results.

I'm testing with this basic query ->User's image Tests

Here are different tests with updated values for the from property in the query's payload.

E.g. From = 0 we have 10 hits as expected.User's image

And showing there are 20,837 results.

Then we test with from = 110 to go up to page 10 ->

User's image

And here also showing the 10 results correctly. The result count seems to still make sense, though it changed without changing the query.

Then another example to the next page 11 ->

User's image

And suddenly no results. And also total changed by a lot, though still a lot higher than 120 results. Thus suddenly that are 10 missed results. Following that I tried the next few pages, and got 10 results in each page as expected.

This behavior happened on at least 3 different tenants I tested at different pages and seem to varies from day to day. The behavior results in empty pages, and/or missing results in certain pages.

We are trying to follow the documentation as explained here -> https://learn.microsoft.com/en-us/graph/api/resources/searchrequest?view=graph-rest-1.0

Regarding Testing environment:

• Issue found on several different tenants.

• Tested using Microsoft Graph Explorer.

• Tested in different browsers.

Further Tests

I made further tests on another day trying to increase paging sequentially:

So I ran this test as follows: Size is always 10User's image

Note how from with these values: 40,50,60,70,80,110 and 120 all have missing hits.

Then tried with 'from' 110 again after 30 minutes and got 0 hits. Same scenario were 160 had results and same number of results.

I would like to understand why the API is behaving this way and what I can do to get good results.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.