lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hetan Shah <Hetan.S...@Sun.COM>
Subject Re: PhraseQuery
Date Mon, 28 Jun 2004 23:46:50 GMT
Thank you very much Erik,

Also wanted to find out if it would be possible to use the highlighter 
class or functionality with demo3 that is included in the distribution 
of Lucene?

It would be really cool to see that functionality in action.

thanks.
-H

Erik Hatcher wrote:

>
> On Jun 28, 2004, at 2:59 PM, Hetan Shah wrote:
>
>> I was wondering if anyone out there had tried the PhraseQuery  class 
>> and retrieved the results. I'm new to the whole search solution. I 
>> have a need to do a exact phrase search. Any code sample would be 
>> really appreciated.
>
>
>     PhraseQuery query = new PhraseQuery();
>
>     for (int i=0; i < words.length; i++) {
>       query.add(new Term("field", phrase[i]));
>     }
>
> That builds a PhraseQuery from a String[] of words and will be an 
> exact match (unless you called setSlop with something greater than zero).
>
>     Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


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


Mime
View raw message