org.apache.lucene.benchmark.byTask.tasks
public abstract class ReadTask extends PerfTask
Note: All ReadTasks reuse the reader if it is already open. Otherwise a reader is opened at start and closed at the end.
The search.num.hits
config parameter sets
the top number of hits to collect during searching.
Other side effects: none.
Constructor and Description |
---|
ReadTask(PerfRunData runData) |
Modifier and Type | Method and Description |
---|---|
int |
doLogic()
Perform the task once (ignoring repetitions specification)
Return number of work items done by this task.
|
protected BenchmarkHighlighter |
getBenchmarkHighlighter(org.apache.lucene.search.Query q)
Return an appropriate highlighter to be used with
highlighting tasks
|
protected java.util.Collection |
getFieldsToHighlight(org.apache.lucene.document.Document document)
Define the fields to highlight.
|
abstract QueryMaker |
getQueryMaker()
Return query maker used for this task.
|
protected org.apache.lucene.search.Sort |
getSort() |
int |
numHits()
Specify the number of hits to retrieve.
|
int |
numToHighlight()
Set to the number of documents to highlight.
|
protected org.apache.lucene.document.Document |
retrieveDoc(org.apache.lucene.index.IndexReader ir,
int id) |
void |
setup()
Task setup work that should not be measured for that specific task.
|
int |
traversalSize()
Specify the number of hits to traverse.
|
boolean |
withMaxScore()
Whether maxScores should be computed (only useful with
field sort)
|
abstract boolean |
withRetrieve()
Return true if, with search & results traversing, docs should be retrieved.
|
boolean |
withScore()
Whether scores should be computed (only useful with
field sort)
|
abstract boolean |
withSearch()
Return true if search should be performed.
|
abstract boolean |
withTraverse()
Return true if, with search, results should be traversed.
|
abstract boolean |
withWarm()
Return true if warming should be performed.
|
clone, close, getDepth, getLogMessage, getName, getParams, getRunData, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, setParams, shouldNeverLogAtStart, shouldNotRecordStats, supportsParams, tearDown, toString
public ReadTask(PerfRunData runData)
public int doLogic() throws java.lang.Exception
PerfTask
protected org.apache.lucene.document.Document retrieveDoc(org.apache.lucene.index.IndexReader ir, int id) throws java.io.IOException
java.io.IOException
public abstract QueryMaker getQueryMaker()
public abstract boolean withSearch()
public abstract boolean withWarm()
public abstract boolean withTraverse()
public boolean withScore()
public boolean withMaxScore()
public int traversalSize()
withTraverse()
is true. Must be greater than 0.
Read task calculates the traversal as: Math.min(hits.length(), traversalSize())public void setup() throws java.lang.Exception
PerfTask
public int numHits()
public abstract boolean withRetrieve()
public int numToHighlight()
protected BenchmarkHighlighter getBenchmarkHighlighter(org.apache.lucene.search.Query q)
protected org.apache.lucene.search.Sort getSort()
protected java.util.Collection getFieldsToHighlight(org.apache.lucene.document.Document document)
document
- The DocumentCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.