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

SpanNearQuery: ordered spans should not overlap

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.10.3, 5.0, 6.0
    • Component/s: core/search
    • Labels:
      None
    • Environment:

      Windows XP, Java 1.6

    • Lucene Fields:
      New, Patch Available

      Description

      While using Span queries I think I've found a little bug.

      With a document like this (from the TestNearSpansOrdered unit test) :

      "w1 w2 w3 w4 w5"

      If I try to search for this span query :

      spanNear([spanNear([field:w3, field:w5], 1, true), field:w4], 0, true)

      the above document is returned and I think it should not because 'w4' is not after 'w5'.
      The 2 spans are not ordered, because there is an overlap.

      I will add a test patch in the TestNearSpansOrdered unit test.
      I will add a patch to solve this issue too.
      Basicaly it modifies the two docSpansOrdered functions to make sure that the spans does not overlap.

        Attachments

        1. SpanOverlapTestUnit.diff
          1 kB
          Ludovic Boutros
        2. SpanOverlap.diff
          1 kB
          Ludovic Boutros
        3. SpanOverlap2.diff
          2 kB
          Ludovic Boutros
        4. LUCENE-3229.patch
          4 kB
          Ludovic Boutros
        5. LUCENE-3229.patch
          6 kB
          Paul Elschot
        6. LUCENE-3229.patch
          7 kB
          Greg Dearing
        7. LUCENE-3229.patch
          7 kB
          Paul Elschot
        8. LUCENE-3229.patch
          8 kB
          Erik Hatcher

          Activity

            People

            • Assignee:
              ehatcher Erik Hatcher
              Reporter:
              lboutros Ludovic Boutros
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: