Share via

Sort order for Sharepoint API “GET sites?search=*”.

Ayase Morita 260 Reputation points
2025-01-30T00:48:53.8266667+00:00

https://learn.microsoft.com/en-us/graph/search-concept-sort

From the above site, we can determine that the “GET sites?search=*” API does not support sorting.

However, the “GET sites?search=&orderby=name” API has changed the sort order compared to the “GET sites?search=” API. So I have two questions.

(1) In what order is “GET sites?search=*” sorted?

(2) In what order is “GET sites?search=*&orderby=name” sorted?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

AllenXu-MSFT 24,991 Reputation points Moderator
2025-01-30T07:04:18.8766667+00:00

Hi @Ayase Morita,

The GET sites?search=* API does not support sorting, and thus the order of the results is not explicitly defined in the documentation. By default, it may return results in an order that is determined by the underlying system, which is typically based on relevance or other internal criteria.

On the other hand, the GET sites?search=*&orderby=name API sorts the results in ascending order based on the name property of the sites. This means that the sites will be returned alphabetically from A to Z.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

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.