Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ReadTask

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Inheritance
    object
    PerfTask
    ReadTask
    SearchTask
    SearchTravTask
    SearchWithSortTask
    WarmTask
    Implements
    IDisposable
    Inherited Members
    PerfTask.m_logStep
    PerfTask.m_params
    PerfTask.NEW_LINE
    PerfTask.SetRunInBackground(int)
    PerfTask.RunInBackground
    PerfTask.BackgroundDeltaPriority
    PerfTask.Stop
    PerfTask.StopNow()
    PerfTask.Clone()
    PerfTask.Dispose()
    PerfTask.Dispose(bool)
    PerfTask.RunAndMaybeStats(bool)
    PerfTask.GetName()
    PerfTask.SetName(string)
    PerfTask.RunData
    PerfTask.Depth
    PerfTask.ToString()
    PerfTask.GetLogMessage(int)
    PerfTask.ShouldNeverLogAtStart
    PerfTask.ShouldNotRecordStats
    PerfTask.TearDown()
    PerfTask.SupportsParams
    PerfTask.SetParams(string)
    PerfTask.Params
    PerfTask.DisableCounting
    PerfTask.AlgLineNum
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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

    ReadTask(PerfRunData)

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    protected ReadTask(PerfRunData runData)
    Parameters
    Type Name Description
    PerfRunData runData
    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.

    ReadTask(PerfRunData, IQueryMaker?)

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    protected ReadTask(PerfRunData runData, IQueryMaker? queryMaker)
    Parameters
    Type Name Description
    PerfRunData runData
    IQueryMaker queryMaker
    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.

    Properties

    NumHits

    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
    int
    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.

    NumToHighlight

    The number of documents to highlight. 0 means no docs will be highlighted.

    Declaration
    public virtual int NumToHighlight { get; }
    Property Value
    Type Description
    int
    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.

    Sort

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    public virtual Sort Sort { get; }
    Property Value
    Type Description
    Sort
    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.

    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
    int
    Remarks

    Unless overridden, the return value is MaxValue.

    WithCollector

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    public virtual bool WithCollector { get; }
    Property Value
    Type Description
    bool
    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.

    WithMaxScore

    Whether maxScores should be computed (only useful with field sort)

    Declaration
    public virtual bool WithMaxScore { get; }
    Property Value
    Type Description
    bool
    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.

    WithRetrieve

    Return true if, with search & results traversing, docs should be retrieved.

    Declaration
    public abstract bool WithRetrieve { get; }
    Property Value
    Type Description
    bool
    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.

    WithScore

    Whether scores should be computed (only useful with field sort)

    Declaration
    public virtual bool WithScore { get; }
    Property Value
    Type Description
    bool
    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.

    WithSearch

    Return true if search should be performed.

    Declaration
    public abstract bool WithSearch { get; }
    Property Value
    Type Description
    bool
    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.

    WithTraverse

    Return true if, with search, results should be traversed.

    Declaration
    public abstract bool WithTraverse { get; }
    Property Value
    Type Description
    bool
    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.

    WithWarm

    Return true if warming should be performed.

    Declaration
    public abstract bool WithWarm { get; }
    Property Value
    Type Description
    bool
    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.

    Methods

    CreateCollector()

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    protected virtual ICollector CreateCollector()
    Returns
    Type Description
    ICollector
    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.

    DoLogic()

    Perform the task once (ignoring repetitions specification). Return number of work items done by this task. For indexing that can be number of docs added. For warming that can be number of scanned items, etc.

    Declaration
    public override int DoLogic()
    Returns
    Type Description
    int

    Number of work items done by this task.

    Overrides
    PerfTask.DoLogic()
    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.

    GetBenchmarkHighlighter(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
    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.

    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 Lucene.Net.Documents.Document.

    Returns
    Type Description
    ICollection<string>

    An ICollection{string} of Lucene.Net.Documents.Field names.

    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.

    GetQueryMaker()

    Return query maker used for this task.

    Declaration
    public abstract IQueryMaker GetQueryMaker()
    Returns
    Type Description
    IQueryMaker
    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.

    RetrieveDoc(IndexReader, int)

    Read index (abstract) task. Sub classes implement WithSearch, WithWarm, WithTraverse and WithRetrieve

    Declaration
    protected virtual Document RetrieveDoc(IndexReader ir, int id)
    Parameters
    Type Name Description
    IndexReader ir
    int id
    Returns
    Type Description
    Document
    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.

    Setup()

    Task setup work that should not be measured for that specific task. By default it does nothing, but tasks can implement this, moving work from DoLogic() to this method. Only the work done in 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.

    Declaration
    public override void Setup()
    Overrides
    PerfTask.Setup()
    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.

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.