Skip to main content
Level 2
10월 16, 2015 2:27 오전 UTC
해결됨

How do I alphabetically order a list of pages and ignore accents?

Hello,

I have a list of pages that I am querying using xpath and ordering by jcr:title.

How do I ignore accented characters?

For example if I have a page with jcr:title = Études, it will show up at the bottom of the list instead of near the top.

 

Thank you.

이 주제는 답변이 닫혔습니다.
BrianKasingli
Adobe Champion and Community Advisor
7월 21, 2023 7:19 오전 UTC

In SQL2 query (also known as JCR-SQL2), you can use the COLLATE function to ignore accented characters when ordering by jcr:title. The COLLATE function allows you to specify a collation to control the sorting behavior.

Here's an example of an SQL2 query that ignores accented characters when ordering by jcr:title:

SELECT * FROM [nt:base] AS node WHERE ISDESCENDANTNODE('/path/to/your/pages') ORDER BY COLLATE(node.[jcr:title], 'ICU_Locale=fr,strength=primary')

In this example, ICU_Locale=fr specifies that the collation should follow French language rules for sorting, and strength=primary specifies that only primary differences (such as accented characters) should be considered significant for ordering.

By using the COLLATE function with the appropriate collation settings, you can ensure that accented characters are ignored when ordering your pages by jcr:title. This will result in a more accurate sorting order that takes into account language-specific rules.

1 답변

BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
7월 21, 2023 7:19 오전 UTC

In SQL2 query (also known as JCR-SQL2), you can use the COLLATE function to ignore accented characters when ordering by jcr:title. The COLLATE function allows you to specify a collation to control the sorting behavior.

Here's an example of an SQL2 query that ignores accented characters when ordering by jcr:title:

SELECT * FROM [nt:base] AS node WHERE ISDESCENDANTNODE('/path/to/your/pages') ORDER BY COLLATE(node.[jcr:title], 'ICU_Locale=fr,strength=primary')

In this example, ICU_Locale=fr specifies that the collation should follow French language rules for sorting, and strength=primary specifies that only primary differences (such as accented characters) should be considered significant for ordering.

By using the COLLATE function with the appropriate collation settings, you can ensure that accented characters are ignored when ordering your pages by jcr:title. This will result in a more accurate sorting order that takes into account language-specific rules.

번역