Repository navigation
SharePoint Online Search REST API parameter sortlist is causing an error (again) #11043
Description
Activity
- addedtype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
on Oct 2, 2026 m365-agent-toolkit-assistant commented
on Oct 2, 2026 More actions👋 Hi Myles Jeffery (@mcgeeky),
Thank you for reporting this issue. Here is an AI-generated initial response:
Classification: Bug — the reported 400 response for
sortlist='[docid]:ascending'conflicts with the documented SharePoint Search REST behavior. The cause of the current failure is not yet confirmed.- Microsoft Learn explicitly uses bracketed
[docid]for ascending sorting and large-result pagination. - The reporter’s query and error closely mirror the 2024 report; users reported that the earlier failure later stopped. That history does not establish a new rollout or rollback.
What to do now:
- Recheck the same query with and without
sortliston affected and unaffected tenants. Omitting it is only a temporary option if sorted results and DocId-based pagination are unnecessary. - Open a Microsoft 365 support case with the request URL, UTC timestamp, tenant, response headers/correlation ID, and both responses. Request investigation of the documented syntax; no current fix or rollout is verified.
Useful links:
Note: AI-generated guidance may be incomplete or incorrect. Please verify suggestions before applying them.
- Microsoft Learn explicitly uses bracketed
Bringing this to your attention Mikael Svenson (@wobba)
I had reports of this happening yesterday too, looks like that issue from 2024 is back.
Reacted by Myles Jeffery and Beau Cameronbcameron1231 commented
on Oct 2, 2026 ContributorMore actionsI am seeing this as well. On one tenant sortList fails, on a different tenant it's working.
Reacted by Myles JefferyDoes it work without brackets? docid:ascending
Does it work without brackets? docid:ascending
No, it does not work without brackets either. The error is:
We didn't understand your search terms. Make sure they're using proper syntaxWithout brackets does work for me.
Something else I've just found is that the square brackets do work if there is no sourceid parameter specified. It seems to be the combination of sourceid and [docid]:ascending that is breaking (at least for me)
- addedarea:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APICategory: SharePoint Client Side Object Model SDK / REST API
on Oct 5, 2026 Thanks for the details. I’ve reached out internally to the engineering team for confirmation on the issue. I’ll post an update here once I hear back from them.
For those with the issue, please remove [] if possible. We will likely update documentation of https://learn.microsoft.com/en-us/sharepoint/dev/general-development/pagination-for-large-result-sets to remove []. That said, we are investigating the regression.
See #11049
Thanks for the update Mikael Svenson (@wobba) . I'm assuming your plan is to revert the regression after your investigation to avoid impact on customers? We have at least one customer with a situation where [docid] and DocId (no square brackets) are causing a search error.
Myles Jeffery (@mcgeeky) still not sure what cause the regression as we should handle with both [] and without in the downstream logic. Mitigation should be to remove it until we find the root cause.
Reacted by Myles Jeffery and Beau CameronMikael Svenson (@wobba) The earliest report we had of the issue was on 1st October, if that is any help with isolating the cause/update. I can provide the name of one of the affected tenants via private message on X?
bcameron1231 commented
on Oct 7, 2026 ContributorMore actionsRemoving the [] also works for me on the tenant it was failing. Supporting both syntax would be great.
Reacted by Myles JefferyMikael Svenson (@wobba) suddenly we having this problem too on our tenants. Its now the next thing with the search api. What is going on here?
Sending this via post (pnpjs). Was working this morning and now suddenly I am getting 400 errors and colleagues reporting that our solution stopped working?
"SortList":[{"Direction":0,"Property":"DocId"}],Fallback with removing the SortList completly from the request works, but thats results in changes in the results...
Reacted by Myles JefferyWe are seeing more reports of the issue with [docid] with square brackets. Is it not possible to stop the rollout of the change request that contains the regression to limit the impact?
hstuermann that's what I see too: DocId is broken, but was previously working, and [docid] is broken but was previously working. docid without square brackets does work.
So there are two forms for [docid]/DocId for the sortlist parameter that have regressed.
Reacted by hstuermannYes I had to implement a fallback now when the API is failing and changed the DocId to docid. But changing the solution every few days to fix sudden changes on MS side is not a working scenario.
Reacted by Myles Jeffery and Christoph SadlederBut changing the solution every few days to fix sudden changes on MS side is not a working scenario.
I agree.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
No response
Describe the bug / error
The SharePoint API endpoint _api/search is returning an error when using the sortlist parameter
sortlist='[docid]:ascending'The error returned is 400 BAD REQUEST with the message:
We didn't understand your search terms. Make sure they're using proper syntax
The full error code is:
This appears to be the same error, or similar to, the one I reported in May 2024 which was subsequently fixed.
If this is a breaking change that has been deployed to SharePoint Online, we need the breaking change rollout stopped and then reverted before the impact spreads further to other tenants.
The sortlist parameter with [docid]=ascending is valid search syntax as per the Microsoft help article here. https://learn.microsoft.com/en-us/sharepoint/dev/general-development/pagination-for-large-result-sets
Steps to reproduce
Open Edge browser, sign in to your SharePoint site then copy and paste this URL in to the address bar and hit return, after changing YOURDOMAIN for your SharePoint tenant name:
https://YOURDOMAIN.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site+(WebTemplate:GROUP OR WebTemplate:TEAMCHANNEL)'&sortlist='[docid]:ascending'You will receive an error message.
If the sortlist parameter is removed from the query then it will succeed:
https://YOURDOMAIN.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site+(WebTemplate:GROUP OR WebTemplate:TEAMCHANNEL)'This will return an error on impacted tenants only. It appears to be affecting only a subset of tenants at present.
Expected behavior
The expected SharePoint search results should be returned, not an error.