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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to