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

DocValuesRangeQuery.newLongRange behaves incorrectly for Long.MAX_VALUE and Long.MIN_VALUE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.2, 5.6, 6.0, 6.1, 7.0
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      It seems that the following queries return all documents, which is unexpected:

      DocValuesRangeQuery.newLongRange("dv", Long.MAX_VALUE, Long.MAX_VALUE, false, true);
      DocValuesRangeQuery.newLongRange("dv", Long.MIN_VALUE, Long.MIN_VALUE, true, false);
      

      In Solr, floats and doubles are converted to longs and -0d gets converted to Long.MIN_VALUE, and queries like {-0d TO 0d] could fail due to this, returning all documents in the index.

        Attachments

        1. LUCENE-7111.patch
          2 kB
          Ishan Chattopadhyaya
        2. LUCENE-7111.patch
          3 kB
          Ishan Chattopadhyaya
        3. LUCENE-7111.patch
          3 kB
          Ishan Chattopadhyaya

          Issue Links

            Activity

              People

              • Assignee:
                steve_rowe Steve Rowe
                Reporter:
                ichattopadhyaya Ishan Chattopadhyaya
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: