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

Add minNumberShouldMatch parameter to SpanNearQuery

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • core/search
    • None
    • New

    Description

      On the user list, saar32 asked about a new type of SpanQuery that would allow for something like BooleanQuery's minimumNumberShouldMatch

      Given a set of search terms (t1, t2, t3, ti), return all documents where in a sequence of x=10 tokens at least c=3 of the search terms appear within the sequence.

      I think we can modify SpanNearQuery fairly easily to accommodate this. I'll submit a PR in the next few days.

      Attachments

        1. TestMinShouldMatchSpan.java
          8 kB
          Mikhail Khludnev
        2. FSA for repeating words.PNG
          130 kB
          Mikhail Khludnev
        3. a b c d e f mm=3.PNG
          44 kB
          Mikhail Khludnev
        4. a b c d e f mm=3.PNG
          52 kB
          Mikhail Khludnev
        5. TestMinShouldMatchSpan.java
          7 kB
          Mikhail Khludnev
        6. AllPairsNearSpans20160902.patch
          30 kB
          Paul Elschot

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tallison Tim Allison
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: