org.compass.core.lucene.engine
Class LuceneSearchEngineHighlighter

java.lang.Object
  extended by org.compass.core.lucene.engine.LuceneSearchEngineHighlighter
All Implemented Interfaces:
SearchEngineHighlighter, LuceneDelegatedClose

public class LuceneSearchEngineHighlighter
extends Object
implements SearchEngineHighlighter, LuceneDelegatedClose

Author:
kimchy

Constructor Summary
LuceneSearchEngineHighlighter(Query query, IndexReader indexReader, LuceneSearchEngine searchEngine)
           
 
Method Summary
 SearchEngineHighlighter clear()
           
 void close()
           
protected  Highlighter createHighlighter(String propertyName)
           
protected  Scorer createScorer(String propertyName)
           
protected  TokenStream createTokenStream(Resource resource, String propertyName, String text)
           
protected  TokenStream createTokenStreamFromAnalyzer(String propertyName, String text)
           
protected  TokenStream createTokenStreamFromTermPositions(Resource resource, String propertyName)
           
 String fragment(Resource resource, String propertyName)
           
 String fragment(Resource resource, String propertyName, String text)
           
 String[] fragments(Resource resource, String propertyName)
           
 String[] fragments(Resource resource, String propertyName, String text)
           
 String fragmentsWithSeparator(Resource resource, String propertyName)
           
 String fragmentsWithSeparator(Resource resource, String propertyName, String text)
           
 String[] multiValueFragment(Resource resource, String propertyName)
           
 String[] multiValueFragment(Resource resource, String propertyName, String[] texts)
           
 String multiValueFragmentWithSeparator(Resource resource, String propertyName)
           
 String multiValueFragmentWithSeparator(Resource resource, String propertyName, String[] texts)
           
 SearchEngineHighlighter setAnalyzer(Resource resource)
           
 SearchEngineHighlighter setAnalyzer(String analyzerName)
           
 SearchEngineHighlighter setHighlighter(String highlighterName)
           
 SearchEngineHighlighter setMaxBytesToAnalyze(int maxBytesToAnalyze)
           
 SearchEngineHighlighter setMaxNumFragments(int maxNumFragments)
           
 SearchEngineHighlighter setSeparator(String separator)
           
 SearchEngineHighlighter setTextTokenizer(CompassHighlighter.TextTokenizer textTokenizer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneSearchEngineHighlighter

public LuceneSearchEngineHighlighter(Query query,
                                     IndexReader indexReader,
                                     LuceneSearchEngine searchEngine)
                              throws SearchEngineException
Throws:
SearchEngineException
Method Detail

clear

public SearchEngineHighlighter clear()
Specified by:
clear in interface SearchEngineHighlighter

setMaxNumFragments

public SearchEngineHighlighter setMaxNumFragments(int maxNumFragments)
                                           throws SearchEngineException
Specified by:
setMaxNumFragments in interface SearchEngineHighlighter
Throws:
SearchEngineException

setMaxBytesToAnalyze

public SearchEngineHighlighter setMaxBytesToAnalyze(int maxBytesToAnalyze)
                                             throws SearchEngineException
Specified by:
setMaxBytesToAnalyze in interface SearchEngineHighlighter
Throws:
SearchEngineException

setAnalyzer

public SearchEngineHighlighter setAnalyzer(String analyzerName)
                                    throws SearchEngineException
Specified by:
setAnalyzer in interface SearchEngineHighlighter
Throws:
SearchEngineException

setAnalyzer

public SearchEngineHighlighter setAnalyzer(Resource resource)
                                    throws SearchEngineException
Specified by:
setAnalyzer in interface SearchEngineHighlighter
Throws:
SearchEngineException

setHighlighter

public SearchEngineHighlighter setHighlighter(String highlighterName)
                                       throws SearchEngineException
Specified by:
setHighlighter in interface SearchEngineHighlighter
Throws:
SearchEngineException

setSeparator

public SearchEngineHighlighter setSeparator(String separator)
                                     throws SearchEngineException
Specified by:
setSeparator in interface SearchEngineHighlighter
Throws:
SearchEngineException

setTextTokenizer

public SearchEngineHighlighter setTextTokenizer(CompassHighlighter.TextTokenizer textTokenizer)
                                         throws SearchEngineException
Specified by:
setTextTokenizer in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragment

public String fragment(Resource resource,
                       String propertyName)
                throws SearchEngineException
Specified by:
fragment in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragment

public String fragment(Resource resource,
                       String propertyName,
                       String text)
                throws SearchEngineException
Specified by:
fragment in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragments

public String[] fragments(Resource resource,
                          String propertyName)
                   throws SearchEngineException
Specified by:
fragments in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragments

public String[] fragments(Resource resource,
                          String propertyName,
                          String text)
                   throws SearchEngineException
Specified by:
fragments in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragmentsWithSeparator

public String fragmentsWithSeparator(Resource resource,
                                     String propertyName)
                              throws SearchEngineException
Specified by:
fragmentsWithSeparator in interface SearchEngineHighlighter
Throws:
SearchEngineException

fragmentsWithSeparator

public String fragmentsWithSeparator(Resource resource,
                                     String propertyName,
                                     String text)
                              throws SearchEngineException
Specified by:
fragmentsWithSeparator in interface SearchEngineHighlighter
Throws:
SearchEngineException

multiValueFragment

public String[] multiValueFragment(Resource resource,
                                   String propertyName)
                            throws SearchEngineException
Specified by:
multiValueFragment in interface SearchEngineHighlighter
Throws:
SearchEngineException

multiValueFragment

public String[] multiValueFragment(Resource resource,
                                   String propertyName,
                                   String[] texts)
                            throws SearchEngineException
Specified by:
multiValueFragment in interface SearchEngineHighlighter
Throws:
SearchEngineException

multiValueFragmentWithSeparator

public String multiValueFragmentWithSeparator(Resource resource,
                                              String propertyName)
                                       throws SearchEngineException
Specified by:
multiValueFragmentWithSeparator in interface SearchEngineHighlighter
Throws:
SearchEngineException

multiValueFragmentWithSeparator

public String multiValueFragmentWithSeparator(Resource resource,
                                              String propertyName,
                                              String[] texts)
                                       throws SearchEngineException
Specified by:
multiValueFragmentWithSeparator in interface SearchEngineHighlighter
Throws:
SearchEngineException

createTokenStream

protected TokenStream createTokenStream(Resource resource,
                                        String propertyName,
                                        String text)
                                 throws SearchEngineException
Throws:
SearchEngineException

createTokenStreamFromAnalyzer

protected TokenStream createTokenStreamFromAnalyzer(String propertyName,
                                                    String text)

createTokenStreamFromTermPositions

protected TokenStream createTokenStreamFromTermPositions(Resource resource,
                                                         String propertyName)
                                                  throws SearchEngineException
Throws:
SearchEngineException

createHighlighter

protected Highlighter createHighlighter(String propertyName)
                                 throws SearchEngineException
Throws:
SearchEngineException

createScorer

protected Scorer createScorer(String propertyName)
                       throws SearchEngineException
Throws:
SearchEngineException

close

public void close()
           throws SearchEngineException
Specified by:
close in interface SearchEngineHighlighter
Specified by:
close in interface LuceneDelegatedClose
Throws:
SearchEngineException


Copyright (c) 2004-2008 The Compass Project.