lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Allison (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7434) Add minNumberShouldMatch parameter to SpanNearQuery
Date Fri, 02 Sep 2016 18:17:20 GMT


Tim Allison commented on LUCENE-7434:

bq. I  think that is too strict when more than the required number of subSpans are actually
present in the segment.

Y, you're right.  Argh.

  public void testMinShouldMatch5() throws Exception {
    //    "x l x m x n x o x"
    SpanNearQuery q = new SpanNearQuery(new SpanQuery[]{
        new SpanTermQuery(new Term(FIELD, "l")), new SpanTermQuery(new Term(FIELD, "m")),
new SpanTermQuery(new Term(FIELD, "o"))
    }, 3, true, 2);
    Spans spans = q.createWeight(searcher, false, 1f).getSpans(searcher.getIndexReader().leaves().get(0),
    assertFinished(spans);//but there should be a match!

> Add minNumberShouldMatch parameter to SpanNearQuery
> ---------------------------------------------------
>                 Key: LUCENE-7434
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>            Reporter: Tim Allison
>            Priority: Minor
>         Attachments: AllPairsNearSpans20160902.patch
> On the user list, [~saar32] asked about a new type of SpanQuery that would allow for
something like BooleanQuery's minimumNumberShouldMatch
> bq. 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.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message