11 feb 2008 kl. 18.16 skrev Cesar Ronchese:

I don't know how to set that filter to Query object.

It is a TokenStream you filter, not the Query. In your case the TokenStream is produced by the QueryParser invoking analyzer.tokenStream(field, new StringReader(input)). So what you have to do is to replace the analyzer with your own implementation.


I'm searching this way:

StandardAnalyzer objAnalyzer = new StandardAnalyzer();

Try this (dry coded) snippet instead:

StandardAnalyzer objAnalyzer = new StandardAnalyzer() {
  public TokenStream tokenStream(String fieldName, Reader reader) {
return new ISOLatin1AccentFilter(super.tokenStream(fieldName, reader));
  }
}

Looking at the code you also probably want to reuse your Analyzer, IndexSearcher and IndexReader and not create a new instance each time you place a query. You can read more about thar and many other things here: <http://wiki.apache.org/lucene-java/BasicsOfPerformance>


   karl

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

Reply via email to