lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Boyd <andrew.b...@mindspring.com>
Subject Re: Should I use span query?
Date Thu, 01 Sep 2005 15:10:56 GMT
If I do a proximity search "terma termb"~10 that will get me the documents that have terma
within 10 words of termb.  But how can I get all the terms 

> that  are within x number of  
> terms of given query terms. 

instead of just the documents.

Thanks,

Andrew

-----Original Message-----
From: Erik Hatcher <erik@ehatchersolutions.com>
Sent: Aug 26, 2005 3:23 PM
To: java-user@lucene.apache.org
Subject: Re: Should I use span query?

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:// 
www.lucenebook.com

By the way, did you see we got slashdotted?  <http:// 
books.slashdot.org/books/05/08/24/1645211.shtml>

     Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message