Describe the bug
The Azure Graph API sends data without sorting according to the matching condition of the search criteria. On the Azure portal, records are returned correctly. There is inconsistent behavior.
Additional context
When I try to find a group using "/groups?$search="displayName:name"&top=10", I do not get the group I am looking for in the list of found groups. This is because my group is much lower in the list compared to those that come in response. That is, the sorting by exact match does not work. However, if I go to the Azure website and try searching through the interface, my group comes first. But the Azure website uses a $batch POST request. Why is the behavior different? I've tried v1.0 and beta, and the behavior is the same.
To Reproduce
CASE 1: Steps to reproduce the behavior:
- Go to https://developer.microsoft.com/en-us/graph/graph-explorer
- Fill the request https://graph.microsoft.com/v1.0/groups?$search="displayName:some-name"
- Click by 'Run query'
- See response
Expected behavior
The first element of the array is the record with the best match based on the displayName field.
Actual behavior
The most matching record is located at the end of the list.
CASE 2: Steps to reproduce the behavior:
- Go to https://developer.microsoft.com/en-us/graph/graph-explorer
- Fill the request https://graph.microsoft.com/v1.0/groups?$search="displayName:some-name&top=1"
- Click by 'Run query'
- See response
Expected behavior
I see the record I am looking for.
Actual behavior
I see another record...
For example, I try to find 'hello-word-group', but I receive next response:
[{
displayName: '123213-hello-word-group'
},{
displayName: '7734743-hello-word-group-4374348'
},{
displayName: 'hello-word-group'
}]
And if I limit entries, I won’t see the group.
Could you please advise if I might be doing something incorrectly and if there's another flag I need to send? Thank you.