public class FastVectorHighlighter extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_FIELD_MATCH |
static boolean |
DEFAULT_PHRASE_HIGHLIGHT |
| Constructor and Description |
|---|
FastVectorHighlighter()
the default constructor.
|
FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch)
a constructor.
|
FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder)
a constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getBestFragment(FieldQuery fieldQuery,
org.apache.lucene.index.IndexReader reader,
int docId,
String fieldName,
int fragCharSize)
return the best fragment.
|
String[] |
getBestFragments(FieldQuery fieldQuery,
org.apache.lucene.index.IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
int maxNumFragments)
return the best fragments.
|
FieldQuery |
getFieldQuery(org.apache.lucene.search.Query query)
create a FieldQuery object.
|
boolean |
isFieldMatch()
return whether fieldMatch or not.
|
boolean |
isPhraseHighlight()
return whether phraseHighlight or not.
|
public static final boolean DEFAULT_PHRASE_HIGHLIGHT
public static final boolean DEFAULT_FIELD_MATCH
public FastVectorHighlighter()
public FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch)
phraseHighlight - true or false for phrase highlightingfieldMatch - true of false for field matchingpublic FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder)
phraseHighlight - true of false for phrase highlightingfieldMatch - true of false for field matchingfragListBuilder - an instance of FragListBuilderfragmentsBuilder - an instance of FragmentsBuilderpublic FieldQuery getFieldQuery(org.apache.lucene.search.Query query)
query - a querypublic final String getBestFragment(FieldQuery fieldQuery, org.apache.lucene.index.IndexReader reader, int docId, String fieldName, int fragCharSize) throws IOException
fieldQuery - FieldQuery objectreader - IndexReader of the indexdocId - document id to be highlightedfieldName - field of the document to be highlightedfragCharSize - the length (number of chars) of a fragmentIOExceptionpublic final String[] getBestFragments(FieldQuery fieldQuery, org.apache.lucene.index.IndexReader reader, int docId, String fieldName, int fragCharSize, int maxNumFragments) throws IOException
fieldQuery - FieldQuery objectreader - IndexReader of the indexdocId - document id to be highlightedfieldName - field of the document to be highlightedfragCharSize - the length (number of chars) of a fragmentmaxNumFragments - maximum number of fragmentsIOExceptionpublic boolean isPhraseHighlight()
public boolean isFieldMatch()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.