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

SortField.AUTO doesn't work with long

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.4
    • Component/s: core/search
    • Labels:
      None

      Description

      This is actually the same as LUCENE-463 but I cannot find a way to re-open that issue. I'm attaching a test case by dragon-fly999 at hotmail com that shows the problem and a patch that seems to fix it.

      The problem is that a long (as used for dates) cannot be parsed as an integer, and the next step is then to parse it as a float, which works but which is not correct. With the patch the following parsers are used in this order: int, long, float.

        Attachments

        1. TestDateSort.java
          4 kB
          Daniel Naber
        2. auto-long-sorting.diff
          4 kB
          Daniel Naber
        3. LUCENE-1045.patch
          7 kB
          Grant Ingersoll
        4. LUCENE-1045.patch
          67 kB
          Grant Ingersoll
        5. LUCENE-1045-shortbyte.patch
          11 kB
          Grant Ingersoll

          Issue Links

            Activity

              People

              • Assignee:
                gsingers Grant Ingersoll
                Reporter:
                lucenebugs@danielnaber.de Daniel Naber
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: