Lucene sorting uses always english locale

Bug #715617 reported by Lassi Immonen on 2011-02-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Lucene sort does not work correctly for different than english locales

This fails:

createDoc("1", "Ä", fi);
createDoc("2", "B", fi);
createDoc("3", "A", fi);
List<Dto> dtos = dao.getAll(fi);
assertEquals("3", dtos.get(0).getId());
assertEquals("2", dtos.get(1).getId() );
assertEquals("1", dtos.get(2).getId());

Lassi Immonen (lassi-immonen) wrote :

Added new constructor parameter to LuceneSerializer:

public LuceneSerializer(boolean lowerCase, boolean splitTerms, Locale sortLocale)

which is used in sort field generation:

sorts.add(new SortField(toField(path), sortLocale, reverse));

In the future we might want to add support to set sort locale per field, but I think it can wait until a real use case emerges.

Changed in querydsl:
status: New → Fix Committed

Released in 2.1.1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers