public class SearchTravRetVectorHighlightTask extends SearchTravTask
Note: This task reuses the reader if it is already open. Otherwise a reader is opened at start and closed at the end.
Takes optional multivalued, comma separated param string as: size[<traversal size>],highlight[<int>],maxFrags[<int>],mergeContiguous[<boolean>],fields[name1;name2;...]
"SearchVecHlgtSameRdr" SearchTravRetVectorHighlight(size[10],highlight[10],maxFrags[3],fields[body]) > : 1000Fields must be stored and term vector offsets and positions in order must be true for this task to work.
Other side effects: counts additional 1 (record) for each traversed hit, and 1 more for each retrieved (non null) document and 1 for each fragment returned.
Modifier and Type | Field and Description |
---|---|
protected int |
fragSize |
protected FastVectorHighlighter |
highlighter |
protected int |
maxFrags |
protected int |
numToHighlight |
protected Set<String> |
paramFields |
traversalSize
Constructor and Description |
---|
SearchTravRetVectorHighlightTask(PerfRunData runData) |
Modifier and Type | Method and Description |
---|---|
protected BenchmarkHighlighter |
getBenchmarkHighlighter(Query q)
Return an appropriate highlighter to be used with
highlighting tasks
|
protected Collection<String> |
getFieldsToHighlight(Document document)
Define the fields to highlight.
|
int |
numToHighlight()
Set to the number of documents to highlight.
|
void |
setParams(String params)
Set the params of this task.
|
void |
setup()
Task setup work that should not be measured for that specific task.
|
boolean |
withRetrieve()
Return true if, with search & results traversing, docs should be retrieved.
|
getQueryMaker, supportsParams, traversalSize, withSearch, withTraverse, withWarm
createCollector, doLogic, getSort, numHits, retrieveDoc, withCollector, withMaxScore, withScore
clone, close, getBackgroundDeltaPriority, getDepth, getLogMessage, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, setRunInBackground, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, tearDown, toString
protected int numToHighlight
protected int maxFrags
protected int fragSize
protected FastVectorHighlighter highlighter
public SearchTravRetVectorHighlightTask(PerfRunData runData)
public void setup() throws Exception
PerfTask
PerfTask.doLogic()
to this method. Only the work done in PerfTask.doLogic()
is measured for this task. Notice that higher level (sequence) tasks
containing this task would then measure larger time than the sum of their
contained tasks.public boolean withRetrieve()
ReadTask
withRetrieve
in class SearchTravTask
public int numToHighlight()
ReadTask
numToHighlight
in class ReadTask
protected BenchmarkHighlighter getBenchmarkHighlighter(Query q)
ReadTask
getBenchmarkHighlighter
in class ReadTask
protected Collection<String> getFieldsToHighlight(Document document)
ReadTask
getFieldsToHighlight
in class ReadTask
document
- The Documentpublic void setParams(String params)
PerfTask
setParams
in class SearchTravTask