org.compass.core.lucene.engine.all
Class AllAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.compass.core.lucene.engine.all.AllAnalyzer

public class AllAnalyzer
extends Analyzer

The All Analyzer is a specific analyzer that is used to wrap the analyzer passed when adding a document. It will gather all the tokens that the actual analyzer generates for fields that are included in All and allow to get them using createAllTokenStream() (which will be used to create the all field with).

Un tokenized fields (which will not go through the analysis process) are identied when this analyzed is constructed and are added to the all field if they are supposed to be included. There are two options with the untokenized fields, either add them as is (un tokenized), or analyze them just for the all properties.

Author:
kimchy

Constructor Summary
AllAnalyzer(Analyzer analyzer, InternalResource resource, LuceneSearchEngine searchEngine)
           
 
Method Summary
 TokenStream createAllTokenStream()
           
 int getPositionIncrementGap(String fieldName)
           
 TokenStream reusableTokenStream(String fieldName, Reader reader)
           
 TokenStream tokenStream(String fieldName, Reader reader)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
getPreviousTokenStream, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllAnalyzer

public AllAnalyzer(Analyzer analyzer,
                   InternalResource resource,
                   LuceneSearchEngine searchEngine)
Method Detail

tokenStream

public TokenStream tokenStream(String fieldName,
                               Reader reader)
Specified by:
tokenStream in class Analyzer

reusableTokenStream

public TokenStream reusableTokenStream(String fieldName,
                                       Reader reader)
                                throws IOException
Overrides:
reusableTokenStream in class Analyzer
Throws:
IOException

getPositionIncrementGap

public int getPositionIncrementGap(String fieldName)
Overrides:
getPositionIncrementGap in class Analyzer

createAllTokenStream

public TokenStream createAllTokenStream()


Copyright (c) 2004-2008 The Compass Project.