3
votes

When using $search to perform a query on messages in the Microsoft Graph API, the numerous pages of the response can be traversed using the odata.nextLink parameter (which itself contains a skiptoken).

I have noticed that for certain search queries, I will at some point not receive a nextLink property to follow and therefore I cannot continue to load the next pages of the result set, despite there definitely being more results to load. I have verified this by comparing in Outlook and with other filter queries.

Steps to reproduce:

  1. In Graph Explorer, enter the following query: https://graph.microsoft.com/v1.0/me/messages?$search="to:[your email address]"&$top=25

  2. When the results load, click on the value of @odata.nextLink to load the next page

  3. Continue to follow the @odata.nextLink until no nextLink parameter is returned in the results

  4. You will notice that you haven't reached the beginning of the inbox (chronologically) but there is no @odata.nextLink property to follow

I can only assume this is a bug with the API - I don't see anything in the documentation about a page limit (https://msdn.microsoft.com/office/office365/api/complex-types-for-mail-contacts-calendar#UseODataqueryparametersSearchrequests).

Is anyone able to help? This problem essentially renders the $search functionality useless for us.

1

1 Answers

3
votes

To optimize for performance, this API currently returns up to 250 search results by default. It sounds like you might be paging to the end of the 250 results, at which point there won't be a nextLink. We're currently making improvements to the API, so it's great to hear this feedback and help us prioritize what we fix (in this case, allowing you to specify the maximum number of results being returned would help you achieve your scenario). Thanks!