Hello,

using PatternAnalyzer solved the problem as well, using a whitespace pattern.
There's lowercase support as well (see 
http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/index/memory/PatternAnalyzer.html)

Many thanks.

Regards,
Ueli Kistler

-----Ursprüngliche Nachricht-----
Von: AHMET ARSLAN [mailto:iori...@yahoo.com] 
Gesendet: Freitag, 14. August 2009 12:56
An: java-user@lucene.apache.org
Betreff: Re: AW: AW: Wildcard search fails

> Noticed that in Luke... is there any existing analyzer around that 
> supports case-insensitive search and recognizes "RZ/G/17" as one token? 

As far as I know there is no built-in analyzer that uses whitespace tokenizer 
and lowercase filter together. But it is easy to cast tokenizer and token 
filters to create a new analyzer. You said that you were using 
SnowballAnalyzer, right? Just replace tokenizer from standard to whitespace. 
Edit SnowballAnalyzer.java :

public TokenStream tokenStream(String fieldName, Reader reader) {
    TokenStream result = new WhitespaceTokenizer(reader);
    result = new LowerCaseFilter(result);
    if (stopSet != null)
      result = new StopFilter(result, stopSet);
    result = new SnowballFilter(result, name);
    return result;
  }

By changing this method you can create custom analyzers. If you do not want 
stemming just erase the line that contains SnowballFilter, etc. Since you have 
lowercasefilter in your analyzer, your wildcard queries should be lowercased. 
Alternatively you can set setLowercaseExpandedTerms(true) of your QueryParser.


      

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


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

Reply via email to