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 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]


Constructor Summary
ConfluenceFilenameAnalyzer(ConfluenceAnalyzer confluenceAnalyzer)
           
 
Method Summary
 org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader)
           
 
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
 

Constructor Detail

ConfluenceFilenameAnalyzer

public ConfluenceFilenameAnalyzer(ConfluenceAnalyzer confluenceAnalyzer)
Method Detail

tokenStream

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


Copyright © 2003-2010 Atlassian. All Rights Reserved.