com.atlassian.confluence.search.lucene
Class ConfluenceFilenameAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by 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 FilenameFilter and LowerCaseFilter in addition to 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.
ConfluenceFilenameAnalyzer divides text at .-_ and converts them to lower case.

Example:
File_Name.java will be tokenized into [file][name][java]


Field Summary
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
ConfluenceFilenameAnalyzer(ConfluenceAnalyzer confluenceAnalyzer)
           
 
Method Summary
 org.apache.lucene.analysis.TokenStream tokenStream(String fieldName, Reader reader)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, reusableTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceFilenameAnalyzer

public ConfluenceFilenameAnalyzer(ConfluenceAnalyzer confluenceAnalyzer)
Method Detail

tokenStream

public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
                                                          Reader reader)
Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer


Copyright © 2003-2011 Atlassian. All Rights Reserved.