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

ParametricRangeQueryNodeProcessor uses incorrect logic at the lower bound

    XMLWordPrintableJSON

    Details

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

      Description

      ParametricRangeQueryNodeProcessor currently works as follows:

      1. If the operator was LE or GE, set inclusive = true.
      2. Set up a calendar
      3. If inclusive, set the second time to 23:59:59:999
      4. Convert that to a string using the DateResolution.

      The problem is, this breaks for exclusive queries. For instance, if the user types in

      {20100110 TO 20100120}

      they would expect to get the 10th to the 20th exclusive, i.e. the 11th to the 19th. But in reality, the 10th will be inclusive.

      To get an actually-exclusive range for the lower bound, the time should be set to 23:59:59:999, much the same as what is done for the inclusive upper bound.

      I suspect the original query parser has the same issue, though possibly in different words.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              trejkaz Trejkaz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: