Class ExactFilenameAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
com.atlassian.confluence.impl.search.v2.lucene.analysis.analyzer.exact.ExactFilenameAnalyzer
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ExactFilenameAnalyzer
extends org.apache.lucene.analysis.Analyzer
Custom analyzer designed for supporting exact matching on file names.
Use when indexing for fields which should support exact matches or when searching for fields which support exact matches for filenames.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.Analyzer.GlobalReuseStrategy, org.apache.lucene.analysis.Analyzer.PerFieldReuseStrategy, org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.analysis.Analyzer.TokenStreamComponentscreateComponents(String fieldName, Reader reader) Only create tokens by whitespace, and lowercase each token.Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, initReader, tokenStream, tokenStream
-
Constructor Details
-
ExactFilenameAnalyzer
public ExactFilenameAnalyzer(org.apache.lucene.util.Version version)
-
-
Method Details
-
createComponents
protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName, Reader reader) Only create tokens by whitespace, and lowercase each token. Filenames will also be split into tokens by the file extension delimiter ".", but all tokens have the same position. The original filename will also be a token.e.g. "filename.txt" -> {"filename.txt", "filename", "txt"}
Searching for the original filename, the name or the extension will match.
Only one of the tokens will be matched per search, consider them alternative names for the file to match on.
- Specified by:
createComponentsin classorg.apache.lucene.analysis.Analyzer
-