public class SearchTravRetHighlightTask extends SearchTravTask
SimpleHTMLFormatter for formatting.
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;...]
"SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000Documents must be stored in order for this task to work. Additionally, term vector positions can be used as well.
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 org.apache.lucene.search.highlight.Highlighter |
highlighter |
protected int |
maxDocCharsToAnalyze |
protected int |
maxFrags |
protected boolean |
mergeContiguous |
protected int |
numToHighlight |
protected Set |
paramFields |
traversalSize| Constructor and Description |
|---|
SearchTravRetHighlightTask(PerfRunData runData) |
| Modifier and Type | Method and Description |
|---|---|
protected BenchmarkHighlighter |
getBenchmarkHighlighter(org.apache.lucene.search.Query q)
Return an appropriate highlighter to be used with
highlighting tasks
|
protected Collection |
getFieldsToHighlight(org.apache.lucene.document.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, withWarmdoLogic, getSort, numHits, retrieveDoc, withMaxScore, withScoreclone, close, getDepth, getLogMessage, getName, getParams, getRunData, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, shouldNeverLogAtStart, shouldNotRecordStats, tearDown, toStringprotected int numToHighlight
protected boolean mergeContiguous
protected int maxFrags
protected Set paramFields
protected org.apache.lucene.search.highlight.Highlighter highlighter
protected int maxDocCharsToAnalyze
public SearchTravRetHighlightTask(PerfRunData runData)
public void setup()
throws Exception
PerfTaskpublic boolean withRetrieve()
ReadTaskwithRetrieve in class SearchTravTaskpublic int numToHighlight()
ReadTasknumToHighlight in class ReadTaskprotected BenchmarkHighlighter getBenchmarkHighlighter(org.apache.lucene.search.Query q)
ReadTaskgetBenchmarkHighlighter in class ReadTaskprotected Collection getFieldsToHighlight(org.apache.lucene.document.Document document)
ReadTaskgetFieldsToHighlight in class ReadTaskdocument - The Documentpublic void setParams(String params)
PerfTasksetParams in class SearchTravTaskCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.