lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Elschot (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3371) Support for a "SpanAndQuery" / "SpanAllNearQuery"
Date Wed, 10 Aug 2011 10:52:27 GMT


Paul Elschot commented on LUCENE-3371:

This could be tested by comparing the results against:

{code}(a WITHIN 5 WORDS OF b) AND (a WITHIN 5 WORDS OF c){code}

The above query is a boolean one, and does not provide a Spans.
Would this SpanAllNearQuery provide a Spans?
When it provides a Spans it can be nested inside other span queries.

> Support for a "SpanAndQuery" / "SpanAllNearQuery"
> -------------------------------------------------
>                 Key: LUCENE-3371
>                 URL:
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: core/search
>            Reporter: Trejkaz
> I would like to parse queries like this:
> {noformat}
> {noformat}
> This would match cases where both a b span and a c span are within 5 of the same a span.
> The existing span query classes do not appear to be capable of doing this no matter how
they are combined, although replacing the AND with "WITHIN 10 OF" (general rule is to double
the first number) at least ensures that no hits are lost (it just returns too many.)
> I'm not sure how the class would work, but it might be like this:
> {code}
>   Query q = new SpanAllNearQuery(a, new SpanQuery[] { b, c }, 5, false);
> {code}
> The difference from SpanNearQuery is that SpanNearQuery considers the entire collection
of terms as a single set to be found near each other, whereas this query would consider each
of the terms in the array relative to the first.

This message is automatically generated by JIRA.
For more information on JIRA, see:


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

View raw message