lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cesar Ronchese <ronch...@hotmail.com>
Subject Re: Indexing accented characters, then searching by any form
Date Mon, 11 Feb 2008 19:39:37 GMT

Woot, Karl. 
It worked like a charm! It even worked with the Highlighter. THANKS!



karl wettin-3 wrote:
> 
> 
> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Indexing-accented-characters%2C-then-searching-by-any-form-tp15412778p15419068.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Mime
View raw message