lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Should I use span query?
Date Fri, 26 Aug 2005 20:23:07 GMT
On Aug 26, 2005, at 4:11 PM, Andrew Boyd wrote:
> Hi All,
>   I'm trying to find all the terms that are within x number of  
> terms of given query terms.  Should I be using span query or  
> something else.  If you have any code samples I would greatly  
> appreciated it.

PhraseQuery, or "termA termB"~10 syntax with QueryParser, provides  
term distance capability as well.  SpanNearQuery certainly will do  
the trick, and has an advantage over PhraseQuery in that it can be  
ordered or unordered whereas PhraseQuery is always irrelevant of order.

There are code examples in the Lucene in Action code found at http://

By the way, did you see we got slashdotted?  <http://>


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

View raw message