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

Ayase Morita 0 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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,911 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,235 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 23,171 Reputation points Microsoft Vendor
    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.

    0 comments No comments

Your answer

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