Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6206

TestCollationDocValuesField.testRanges failure

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This test failed in branch_5x:

      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
      

      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:

      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
        }
      }
      

      Note that if you change java.text.Collator to com.ibm.icu.text.Collator, they are consistent. Looks like a bug in JDK collation.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcmuir Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: