Robert Muir created LUCENE-6206:
-----------------------------------
Summary: TestCollationDocValuesField.testRanges failure
Key: LUCENE-6206
URL: https://issues.apache.org/jira/browse/LUCENE-6206
Project: Lucene - Core
Issue Type: Task
Reporter: Robert Muir
This test failed in branch_5x:
{noformat}
ant test -Dtestcase=TestCollationDocValuesField -Dtests.method=testRanges
-Dtests.seed=8729A11DAE9AE179 -Dtests.multiplier=3 -Dtests.slow=true
-Dtests.locale=lt -Dtests.timezone=Etc/GMT-8 -Dtests.asserts=true
-Dtests.file.encoding=UTF-8
{noformat}
The problem is, with lithuanian collator, the generated collationkey does not
agree with collation order.
In other words: collator.compare("yi", "iy") !=
collator.getCollationKey("yi").compareTo(collator.getCollationKey("iy"))
Simple test:
{code}
import java.text.Collator;
import java.util.Locale;
public class TestLithuanian {
public static void main(String args[]) throws Exception {
Collator collator = Collator.getInstance(new Locale("lt"));
int value = collator.compare("yi", "iy");
System.out.println(value); // returns 1
int value2 =
collator.getCollationKey("yi").compareTo(collator.getCollationKey("iy"));
System.out.println(value2); // returns -1
}
}
{code}
Note that if you change java.text.Collator to com.ibm.icu.text.Collator, they
are consistent. Looks like a bug in JDK collation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]