org.alfresco.repo.search.impl.lucene
Class LuceneAnalyser

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.alfresco.repo.search.impl.lucene.AbstractAnalyzer
          extended by org.alfresco.repo.search.impl.lucene.LuceneAnalyser

public class LuceneAnalyser
extends AbstractAnalyzer

Analyse properties according to the property definition. The default is to use the standard tokeniser. The tokeniser should not have been called when indexing properties that require no tokenisation. (tokenise should be set to false when adding the field to the document)


Constructor Summary
LuceneAnalyser(DictionaryService dictionaryService, MLAnalysisMode mlAlaysisMode)
          Constructs with a default standard analyser
 
Method Summary
 int getPositionIncrementGap(java.lang.String fieldName)
          For multilingual fields we separate the tokens for each instance to break phrase queries spanning different languages etc.
 org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader)
           
 org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader, AnalysisMode analysisMode)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getPreviousTokenStream, reusableTokenStream, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneAnalyser

public LuceneAnalyser(DictionaryService dictionaryService,
                      MLAnalysisMode mlAlaysisMode)
Constructs with a default standard analyser

Parameters:
defaultAnalyzer - Any fields not specifically defined to use a different analyzer will use the one provided here.
Method Detail

tokenStream

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

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

getPositionIncrementGap

public int getPositionIncrementGap(java.lang.String fieldName)
For multilingual fields we separate the tokens for each instance to break phrase queries spanning different languages etc.

Overrides:
getPositionIncrementGap in class org.apache.lucene.analysis.Analyzer


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.