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

Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator(); remove natural comparator in favour of Java 8 one

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 6.0
    • core/other
    • None
    • New

    Description

      Followup from LUCENE-7052: This removes the legacy, deprecated getUTF8SortedAsUTF16Comparator() in the BytesRef class. I know originally we added the different comparators to be able to allow the index term dict to be sorted in different order. This never proved to be useful, as many Lucene queries rely on the default order. The only codec that used another byte order internally was the Lucene 3 one (but it used the unicode spaghetti algorithm to reorder its term enums at runtime).

      This patch also removes the BytesRef-Comparator completely and just implements compareTo. So all code can rely on natural ordering.

      This patch also cleans up other usages of natural order comparators, e.g. in ArrayUtil, because Java 8 natively provides a comparator.

      Attachments

        1. LUCENE-7053.patch
          43 kB
          Uwe Schindler
        2. LUCENE-7053.patch
          29 kB
          Uwe Schindler
        3. LUCENE-7053.patch
          17 kB
          Uwe Schindler
        4. LUCENE-7053.patch
          14 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: