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
SharePoint Online (Microsoft 365)
Site language: Swedish (1053)
Sorted property: Filename (sortable: yes)
Tried with and without Culture=1053 in the query
Describe the bug / error
When sorting search results alphabetically using the SharePoint Online Search REST API (/_api/search/query with sortlist), Swedish characters are not sorted according to Swedish collation rules. Instead of å, ä and ö being placed at the end of the alphabet (after z), they are sorted together with their base letters, so "å" and "ä" appear among "a", and "ö" appears among "o".
We noticed this behavior when using PnP modern search web part but we have tested this against the API.
Images below shows what it looks like from the search web part:
Question:
Is this expected behavior or a known limitation of the search index, where sorting is accent-insensitive and not culture-aware? If so, is there a supported way to get culture-specific sorting (Swedish) directly from the Search API, without having to sort client-side? If it is not intended behavior, could this be treated as a bug?
Steps to reproduce
- Create or use a list or library with items whose titles start with a, å, ä, o, ö and z.
- Query the Search API, for example:
_api/search/query?querytext='ändra'&sortlist='Filename:ascending'&Culture=1053
- Observe that the order does not follow Swedish alphabetical rules.
Expected behavior
Results sorted in ascending order should follow Swedish collation: ... x, y, z, å, ä, ö.
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
SharePoint Online (Microsoft 365)
Site language: Swedish (1053)
Sorted property: Filename (sortable: yes)
Tried with and without Culture=1053 in the query
Describe the bug / error
When sorting search results alphabetically using the SharePoint Online Search REST API (/_api/search/query with sortlist), Swedish characters are not sorted according to Swedish collation rules. Instead of å, ä and ö being placed at the end of the alphabet (after z), they are sorted together with their base letters, so "å" and "ä" appear among "a", and "ö" appears among "o".
We noticed this behavior when using PnP modern search web part but we have tested this against the API.
Images below shows what it looks like from the search web part:
Question:
Is this expected behavior or a known limitation of the search index, where sorting is accent-insensitive and not culture-aware? If so, is there a supported way to get culture-specific sorting (Swedish) directly from the Search API, without having to sort client-side? If it is not intended behavior, could this be treated as a bug?
Steps to reproduce
_api/search/query?querytext='ändra'&sortlist='Filename:ascending'&Culture=1053
Expected behavior
Results sorted in ascending order should follow Swedish collation: ... x, y, z, å, ä, ö.