Lucene - Core
  1. Lucene - Core
  2. LUCENE-1379

SpanScorer fails when sloppyFreq() returns 0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I think we should fix this for 2.4 (now back to 10)?

      1. LUCENE-1379.patch
        0.7 kB
        Paul Elschot
      2. LUCENE-1379-test.patch
        2 kB
        Paul Elschot

        Activity

        Hide
        Michael McCandless added a comment -

        Sending src/java/org/apache/lucene/search/spans/SpanScorer.java
        Sending src/test/org/apache/lucene/search/spans/TestSpans.java
        Transmitting file data ..
        Committed revision 696013.

        Thanks Paul!

        Show
        Michael McCandless added a comment - Sending src/java/org/apache/lucene/search/spans/SpanScorer.java Sending src/test/org/apache/lucene/search/spans/TestSpans.java Transmitting file data .. Committed revision 696013. Thanks Paul!
        Hide
        Paul Elschot added a comment -

        For this cornercase I thought a test case would be smaller than an explanation, but you just proved me wrong.

        Show
        Paul Elschot added a comment - For this cornercase I thought a test case would be smaller than an explanation, but you just proved me wrong.
        Hide
        Michael McCandless added a comment -

        OK I now understand this patch – checking freq != 0 (as the return value) is not a valid way to return the value for next() or skipTo(), because sloppyFreq could return 0, for the last doc in the in iteration.

        I will commit shortly! Thanks Paul.

        Show
        Michael McCandless added a comment - OK I now understand this patch – checking freq != 0 (as the return value) is not a valid way to return the value for next() or skipTo(), because sloppyFreq could return 0, for the last doc in the in iteration. I will commit shortly! Thanks Paul.
        Hide
        Paul Elschot added a comment -

        Since this is really a corner case, it does not really matter whether it gets into 2.4 or not.

        Show
        Paul Elschot added a comment - Since this is really a corner case, it does not really matter whether it gets into 2.4 or not.
        Hide
        Paul Elschot added a comment -

        The bug occurs only for the last matching doc.
        The attached LUCENE-1379-test.patch adds a test case for this, the test passes with the other LUCENE-1379.patch applied, and fails on trunk.

        Show
        Paul Elschot added a comment - The bug occurs only for the last matching doc. The attached LUCENE-1379 -test.patch adds a test case for this, the test passes with the other LUCENE-1379 .patch applied, and fails on trunk.
        Hide
        Mark Miller added a comment -

        How does it fail Paul? I am trying to duplicate by returning 0 with a custom Similarity. This causes a score of 0 of course, but I don't see the failure. After applying your patch, I see the same behavior - a total score of a zero and no failure (that I can tell of course). Any hints about the problem?

        Show
        Mark Miller added a comment - How does it fail Paul? I am trying to duplicate by returning 0 with a custom Similarity. This causes a score of 0 of course, but I don't see the failure. After applying your patch, I see the same behavior - a total score of a zero and no failure (that I can tell of course). Any hints about the problem?
        Hide
        Paul Elschot added a comment -

        The patch of 20080908 compiles, but it is untested because of other changes pending in my working copy.

        Show
        Paul Elschot added a comment - The patch of 20080908 compiles, but it is untested because of other changes pending in my working copy.

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Paul Elschot
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development