lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Tignor <>
Subject minimum range for SpanQueries
Date Mon, 21 Dec 2009 22:01:16 GMT
Is there are way to implement a minimum range for a SpanQuery or combination

For example, using:

"The boy said hello to the boy"

I'd like to use a SpanNearQuery consisting of the terms "The" and "boy" that
returns one span including the entire sentence but not a span for the first
two words.
Thus, I'd like to specify a minimum range of at least 1 and a maximum of
say, 5 here.

I note that using a SpanNotQuery consisting of two SpanNearQueries with the
same terms and these above ranges does not work as the desired longer
SpanResult will include the shorter one and get weeded out.

thanks -



Christopher Tignor | Senior Software Architect
155 Spring Street NY, NY 10012
p.212-285-8600 x385 f.212-285-8999

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message