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

SortField.AUTO doesn't work with long

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2
    • 2.4
    • core/search
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment