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 = searcher.search(query);
And so your "How" term should be "how" in order to match what you indexed.
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:
http://wiki.apache.org/jakarta-lucene/AnalysisParalysis
In other words, knowing *exactly* what you indexed is extremely vital in understanding issues with querying.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]