lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: How to use PhraseQuery Class?
Date Wed, 16 Jun 2004 13:06:53 GMT
On Jun 16, 2004, at 8:45 AM, Daniel de Souza Teixeira wrote:
> Do I need to use some special kind of Analyzer on the index method ?

What analyzer did you use?  SimpleAnalyzer lowercases....

> PhraseQuery query = new PhraseQuery();
> query.setSlop(2);
> query.add(new Term("contents", "How"));
> query.add(new Term("contents", "can"));
> System.out.println( "Query: " + query.toString());
> Hits hits =;

And so your "How" term should be "how" in order to match what you 

Be sure to read and understand issues you can encounter with analysis 
in the picture, or in your case in the picture during indexing, but not 
during querying:

In other words, knowing *exactly* what you indexed is extremely vital 
in understanding issues with querying.


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

View raw message