Lucene - Core
  1. Lucene - Core
  2. LUCENE-3971

MappingCharFilter rarely has wrong correctOffset (for finalOffset)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA, 3.6.1
    • Component/s: modules/analysis
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Found this bug over on LUCENE-3969, but I'm currently tracking a ton of bugs, so
      I figure I would open an issue and see if this one is obvious to anyone:

      Consider this input string: "gzw f quaxot" (length = 12) with a WhitespaceTokenizer.
      If i have mapping rules like this, then it works!:

      "t" => ""
      

      But if I have mapping rules like this:

      "t" => ""
      "tmakdbl" => "c"
      

      Then it will compute final offset wrong:

          [junit] junit.framework.AssertionFailedError: finalOffset  expected:<12> but was:<11>
      

      Looks like some logic/recursion bug in the correctOffset method? The second rule is not even "used" for this string,
      it just happens to also start with 't'

      1. LUCENE-3971.patch
        3 kB
        Dawid Weiss
      2. LUCENE-3971_test.patch
        3 kB
        Robert Muir

        Issue Links

          Activity

          Robert Muir created issue -
          Robert Muir made changes -
          Field Original Value New Value
          Attachment LUCENE-3971_test.patch [ 12522247 ]
          Dawid Weiss made changes -
          Link This issue relates to LUCENE-3830 [ LUCENE-3830 ]
          Dawid Weiss made changes -
          Attachment LUCENE-3971.patch [ 12522476 ]
          Dawid Weiss made changes -
          Assignee Dawid Weiss [ dweiss ]
          Dawid Weiss made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Robert Muir made changes -
          Fix Version/s 3.6.1 [ 12320752 ]
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Dawid Weiss
              Reporter:
              Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development