Skip to content

SharePoint Online Search API sorts Swedish characters å, ä, ö together with a and o instead of after z #11039

Description

@Mattias-I

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

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

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:

Image
Image

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

  1. Create or use a list or library with items whose titles start with a, å, ä, o, ö and z.
  2. Query the Search API, for example:
    _api/search/query?querytext='ändra'&sortlist='Filename:ascending'&Culture=1053
  3. Observe that the order does not follow Swedish alphabetical rules.

Expected behavior

Results sorted in ascending order should follow Swedish collation: ... x, y, z, å, ä, ö.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions