|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.search.vectorhighlight.FastVectorHighlighter
public class FastVectorHighlighter
Another highlighter implementation.
| Field Summary | |
|---|---|
static boolean |
DEFAULT_FIELD_MATCH
|
static boolean |
DEFAULT_PHRASE_HIGHLIGHT
|
| Constructor Summary | |
|---|---|
FastVectorHighlighter()
the default constructor. |
|
FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch)
a constructor. |
|
FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder)
a constructor. |
|
| Method Summary | |
|---|---|
String |
getBestFragment(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize)
return the best fragment. |
String |
getBestFragment(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
return the best fragment. |
String[] |
getBestFragments(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
int maxNumFragments)
return the best fragments. |
String[] |
getBestFragments(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
int maxNumFragments,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
return the best fragments. |
String[] |
getBestFragments(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String storedField,
Set<String> matchedFields,
int fragCharSize,
int maxNumFragments,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
Return the best fragments. |
FieldQuery |
getFieldQuery(Query query)
create a FieldQuery object. |
FieldQuery |
getFieldQuery(Query query,
IndexReader reader)
create a FieldQuery object. |
int |
getPhraseLimit()
|
boolean |
isFieldMatch()
return whether fieldMatch or not. |
boolean |
isPhraseHighlight()
return whether phraseHighlight or not. |
void |
setPhraseLimit(int phraseLimit)
set the maximum number of phrases to analyze when searching for the highest-scoring phrase. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_PHRASE_HIGHLIGHT
public static final boolean DEFAULT_FIELD_MATCH
| Constructor Detail |
|---|
public FastVectorHighlighter()
public FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch)
SimpleFragListBuilder and ScoreOrderFragmentsBuilder.
phraseHighlight - true or false for phrase highlightingfieldMatch - true of false for field matching
public FastVectorHighlighter(boolean phraseHighlight,
boolean fieldMatch,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder)
FragListBuilder and a FragmentsBuilder can be specified (plugins).
phraseHighlight - true of false for phrase highlightingfieldMatch - true of false for field matchingfragListBuilder - an instance of FragListBuilderfragmentsBuilder - an instance of FragmentsBuilder| Method Detail |
|---|
public FieldQuery getFieldQuery(Query query)
FieldQuery object.
query - a query
FieldQuery object
public FieldQuery getFieldQuery(Query query,
IndexReader reader)
throws IOException
FieldQuery object.
query - a query
FieldQuery object
IOException
public final String getBestFragment(FieldQuery fieldQuery,
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 fragment
IOException - If there is a low-level I/O error
public final String[] getBestFragments(FieldQuery fieldQuery,
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 fragments
IOException - If there is a low-level I/O error
public final String getBestFragment(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
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 fragmentfragListBuilder - FragListBuilder objectfragmentsBuilder - FragmentsBuilder objectpreTags - pre-tags to be used to highlight termspostTags - post-tags to be used to highlight termsencoder - an encoder that generates encoded text
IOException - If there is a low-level I/O error
public final String[] getBestFragments(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String fieldName,
int fragCharSize,
int maxNumFragments,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
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 fragmentsfragListBuilder - FragListBuilder objectfragmentsBuilder - FragmentsBuilder objectpreTags - pre-tags to be used to highlight termspostTags - post-tags to be used to highlight termsencoder - an encoder that generates encoded text
IOException - If there is a low-level I/O error
public final String[] getBestFragments(FieldQuery fieldQuery,
IndexReader reader,
int docId,
String storedField,
Set<String> matchedFields,
int fragCharSize,
int maxNumFragments,
FragListBuilder fragListBuilder,
FragmentsBuilder fragmentsBuilder,
String[] preTags,
String[] postTags,
Encoder encoder)
throws IOException
StringIndexOutOfBoundsException
if matchedFields produces offsets outside of storedField. As such it is advisable that all
matchedFields share the same source as storedField or are at least a prefix of it.
fieldQuery - FieldQuery objectreader - IndexReader of the indexdocId - document id to be highlightedstoredField - field of the document that stores the textmatchedFields - fields of the document to scan for matchesfragCharSize - the length (number of chars) of a fragmentmaxNumFragments - maximum number of fragmentsfragListBuilder - FragListBuilder objectfragmentsBuilder - FragmentsBuilder objectpreTags - pre-tags to be used to highlight termspostTags - post-tags to be used to highlight termsencoder - an encoder that generates encoded text
IOException - If there is a low-level I/O errorpublic boolean isPhraseHighlight()
public boolean isFieldMatch()
public int getPhraseLimit()
public void setPhraseLimit(int phraseLimit)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||