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

False assertion of >0 position delta in StandardPostingsWriterImpl

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.0-ALPHA
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      StandardPostingsWriterImpl line 159 is:

          assert delta > 0 || position == 0 || position == -1: "position=" + position + " lastPosition=" + lastPosition;            // not quite right (if pos=0 is repeated twice we don't catch it)
      

      I enable assertions when I run my unit tests and I've found this assertion to fail when delta is 0 which occurs when the same position value is sent in twice in arrow. Once I added RemoveDuplicatesTokenFilter, this problem went away. Should I really be forced to add this filter? I think delta >= 0 would be a better assertion.

        Attachments

          Activity

            People

            • Assignee:
              mikemccand Michael McCandless
              Reporter:
              dsmiley David Smiley
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: