FAQ
I have a custom analyzer I've created so that certain fields, which are
indexed as Keywords, can be search exactly as they are typed in. Using this
custom analyzer however produces not hits. Using Luke, I can see that the
field values are identical to the values passed in on the query...

My query is: class.name:(someCaseSensitiveString.that.Can.include.Periods)


My custom Analyzer:

public static class DefaultAnalyzer extends Analyzer {
public TokenStream tokenStream(String fieldName, Reader reader) {
LOG.debug("analyzing: " + fieldName);

if ("class.name".equals(fieldName)) {
LOG.debug("not analyzing");
return new CharTokenizer(reader) {
protected boolean isTokenChar(char c) {
return true;
}
};
} else {
LOG.debug("analyzing");
StandardTokenizer tokenizer = new StandardTokenizer(reader);
TokenStream result = null;
result = new LowerCaseFilter(tokenizer);
result = new StopFilter(result,
StopAnalyzer.ENGLISH_STOP_WORDS);
result = new PorterStemFilter(result);
return result;
}
}
}




Any ideas?


Thank You



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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedAug 4, '05 at 5:15p
activeAug 4, '05 at 5:36p
posts3
users2
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase