Lucene sorting uses always english locale

Bug #715617 reported by Lassi Immonen
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());

Revision history for this message
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
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.