lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Byrne <>
Subject Re: Nested Proximity searches
Date Tue, 01 Jul 2008 09:14:41 GMT
The QueryParser syntax does not support what you're trying to do. 
However, it is possible to do with the API. If you can construct your 
Query programatically, you can use the SpanQuery API to do what you need.

Proximity searching is achieved using the SpanNearQuery; the constructor 
of this object takes an array of generic SpanQuerys - so you can nest 
SpanQuerys within other SpanQuerys.


David Lee wrote:
> Is it possible to do nested proximity searches with lucene?
> i.e. can I say I want a to be within 1 word of b and then that group to be
> within 4 words of c? The syntax ""a b"~1" c"~4 doesn't seem to work (since
> it treats the first two quotes as a pair and the later 2 as another pair).
> ------------------------------------------------------------------------
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 7.5.524 / Virus Database: 270.4.3/1527 - Release Date: 30/06/2008 18:07

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

View raw message