com.atlassian.confluence.search.lucene
Class ConfluenceFilenameAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
com.atlassian.confluence.search.lucene.ConfluenceFilenameAnalyzer
public class ConfluenceFilenameAnalyzer
- extends org.apache.lucene.analysis.Analyzer
Since the ConfluenceAnalyzer does not handle filenames very well, we have a different Analyzer for that field.
The main difference is the use of the LowerCaseTokenizer
instead of the StandardTokenizer
.
The Standard Tokenizer kept parts of the filename and the filename extension together as one token. Therefore
it was not possible to search for only the filetype or parts of the filename.
The LowerCaseTokenizer
divides text at non-letters and converts
them to lower case.
Example:
File_Name.java will be tokenized into [file][name][java]
Methods inherited from class org.apache.lucene.analysis.Analyzer |
getPositionIncrementGap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfluenceFilenameAnalyzer
public ConfluenceFilenameAnalyzer(ConfluenceAnalyzer confluenceAnalyzer)
tokenStream
public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
Reader reader)
- Specified by:
tokenStream
in class org.apache.lucene.analysis.Analyzer