Class ReadTask
Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve
Implements
Inherited Members
Namespace: Lucene.Net.Benchmarks.ByTask.Tasks
Assembly: Lucene.Net.Benchmark.dll
Syntax
public abstract class ReadTask : PerfTask, IDisposable
  Remarks
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.  If
print.hits.field is set, then each hit is
printed along with the value of that field.
Other side effects: none.
Constructors
| Improve this Doc View SourceReadTask(PerfRunData)
Declaration
public ReadTask(PerfRunData runData)
  Parameters
| Type | Name | Description | 
|---|---|---|
| PerfRunData | runData | 
Properties
| Improve this Doc View SourceNumHits
Specify the number of hits to retrieve. Tasks should override this if they want to restrict the number of hits that are collected during searching. Must be greater than 0.
Returns 10 by default, or search.num.hits config if set.
Declaration
public virtual int NumHits { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
NumToHighlight
The number of documents to highlight. 0 means no docs will be highlighted.
Declaration
public virtual int NumToHighlight { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Sort
Declaration
public virtual Sort Sort { get; }
  Property Value
| Type | Description | 
|---|---|
| Sort | 
TraversalSize
Specify the number of hits to traverse.  Tasks should override this if they want to restrict the number
of hits that are traversed when WithTraverse is true. Must be greater than 0.
Read task calculates the traversal as: Math.Min(hits.Length, TraversalSize)
Declaration
public virtual int TraversalSize { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Remarks
Unless overridden, the return value is System.Int32.MaxValue.
WithCollector
Declaration
public virtual bool WithCollector { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithMaxScore
Whether maxScores should be computed (only useful with field sort)
Declaration
public virtual bool WithMaxScore { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithRetrieve
Return true if, with search & results traversing, docs should be retrieved.
Declaration
public abstract bool WithRetrieve { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithScore
Whether scores should be computed (only useful with field sort)
Declaration
public virtual bool WithScore { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithSearch
Return true if search should be performed.
Declaration
public abstract bool WithSearch { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithTraverse
Return true if, with search, results should be traversed.
Declaration
public abstract bool WithTraverse { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
WithWarm
Return true if warming should be performed.
Declaration
public abstract bool WithWarm { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Methods
| Improve this Doc View SourceCreateCollector()
Declaration
protected virtual ICollector CreateCollector()
  Returns
| Type | Description | 
|---|---|
| ICollector | 
DoLogic()
Declaration
public override int DoLogic()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
Overrides
| Improve this Doc View SourceGetBenchmarkHighlighter(Query)
Return an appropriate highlighter to be used with highlighting tasks.
Declaration
protected virtual BenchmarkHighlighter GetBenchmarkHighlighter(Query q)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Query | q | 
Returns
| Type | Description | 
|---|---|
| BenchmarkHighlighter | 
GetFieldsToHighlight(Document)
Define the fields to highlight. Base implementation returns all fields.
Declaration
protected virtual ICollection<string> GetFieldsToHighlight(Document document)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Document | document | The Document.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.ICollection<System.String> | An ICollection{string} of Field names.  | 
      
GetQueryMaker()
Return query maker used for this task.
Declaration
public abstract IQueryMaker GetQueryMaker()
  Returns
| Type | Description | 
|---|---|
| IQueryMaker | 
RetrieveDoc(IndexReader, Int32)
Declaration
protected virtual Document RetrieveDoc(IndexReader ir, int id)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IndexReader | ir | |
| System.Int32 | id | 
Returns
| Type | Description | 
|---|---|
| Document | 
Setup()
Declaration
public override void Setup()