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

Sloppy Phrase Scorer matches the doc "A B C D E" for query = "B C B"~2


    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.2
    • core/search
    • None
    • Patch Available


      This is an extension of https://issues.apache.org/jira/browse/LUCENE-697

      In addition to abnormalities Yonik pointed out in 697, there seem to be other issues with slopy phrase search and scoring.

      1) A phrase with a repeated word would be detected in a document although it is not there.
      I.e. document = A B D C E , query = "B C B" would not find this document (as expected), but query "B C B"~2 would find it.
      I think that no matter how large the slop is, this document should not be a match.

      2) A document containing both orders of a query, symmetrically, would score differently for the queru and for its reveresed form.
      I.e. document = A B C B A would score differently for queries "B C"~2 and "C B"~2, although it is symmetric to both.

      I will attach test cases that show both these problems and the one reported by Yonik in 697.


        1. sloppy_phrase.patch3.txt
          27 kB
          Doron Cohen
        2. sloppy_phrase.patch3.txt
          30 kB
          Doron Cohen
        3. sloppy_phrase.patch2.txt
          25 kB
          Doron Cohen
        4. sloppy_phrase_tests.patch.txt
          12 kB
          Doron Cohen
        5. sloppy_phrase_java.patch.txt
          12 kB
          Doron Cohen
        6. res-search-orig2.log
          364 kB
          Doron Cohen
        7. res-search-new2.log
          363 kB
          Doron Cohen
        8. perf-search-orig.log
          184 kB
          Doron Cohen
        9. perf-search-new.log
          184 kB
          Doron Cohen

        Issue Links



              doronc Doron Cohen
              doronc Doron Cohen
              0 Vote for this issue
              0 Start watching this issue