Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SearchTravRetHighlightTask

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Inheritance
    object
    PerfTask
    ReadTask
    SearchTravTask
    SearchTravRetHighlightTask
    Implements
    IDisposable
    Inherited Members
    SearchTravTask.m_traversalSize
    SearchTravTask.WithSearch
    SearchTravTask.WithTraverse
    SearchTravTask.WithWarm
    SearchTravTask.GetQueryMaker()
    SearchTravTask.TraversalSize
    SearchTravTask.SupportsParams
    ReadTask.DoLogic()
    ReadTask.CreateCollector()
    ReadTask.RetrieveDoc(IndexReader, int)
    ReadTask.WithCollector
    ReadTask.WithScore
    ReadTask.WithMaxScore
    ReadTask.NumHits
    ReadTask.Sort
    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.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 class SearchTravRetHighlightTask : SearchTravTask, IDisposable
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    Constructors

    SearchTravRetHighlightTask(PerfRunData)

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    public SearchTravRetHighlightTask(PerfRunData runData)
    Parameters
    Type Name Description
    PerfRunData runData
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    Fields

    m_highlighter

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected Highlighter m_highlighter
    Field Value
    Type Description
    Highlighter
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    m_maxDocCharsToAnalyze

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected int m_maxDocCharsToAnalyze
    Field Value
    Type Description
    int
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    m_maxFrags

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected int m_maxFrags
    Field Value
    Type Description
    int
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    m_mergeContiguous

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected bool m_mergeContiguous
    Field Value
    Type Description
    bool
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    m_numToHighlight

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected int m_numToHighlight
    Field Value
    Type Description
    int
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    m_paramFields

    Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.

    Declaration
    protected ISet<string> m_paramFields
    Field Value
    Type Description
    ISet<string>
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    Properties

    NumToHighlight

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

    Declaration
    public override int NumToHighlight { get; }
    Property Value
    Type Description
    int
    Overrides
    ReadTask.NumToHighlight
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    WithRetrieve

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

    Declaration
    public override bool WithRetrieve { get; }
    Property Value
    Type Description
    bool
    Overrides
    SearchTravTask.WithRetrieve
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    Methods

    GetBenchmarkHighlighter(Query)

    Return an appropriate highlighter to be used with highlighting tasks.

    Declaration
    protected override BenchmarkHighlighter GetBenchmarkHighlighter(Query q)
    Parameters
    Type Name Description
    Query q
    Returns
    Type Description
    BenchmarkHighlighter
    Overrides
    ReadTask.GetBenchmarkHighlighter(Query)
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    GetFieldsToHighlight(Document)

    Define the fields to highlight. Base implementation returns all fields.

    Declaration
    protected override 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.

    Overrides
    ReadTask.GetFieldsToHighlight(Document)
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    SetParams(string)

    Set the params of this task.

    Declaration
    public override void SetParams(string @params)
    Parameters
    Type Name Description
    string params
    Overrides
    SearchTravTask.SetParams(string)
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

    Documents 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.
    Exceptions
    Type Condition
    NotSupportedException

    For tasks supporting command line parameters.

    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
    ReadTask.Setup()
    Remarks

    Uses the Lucene.Net.Search.Highlight.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;...]
    traversal sizeThe number of hits to traverse, otherwise all will be traversed.
    highlightThe number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length).
    maxFragsThe maximum number of fragments to score by the highlighter.
    mergeContiguoustrue if contiguous fragments should be merged.
    fieldsThe fields to highlight. If not specified all fields will be highlighted (or at least attempted).

    Example:
    "SearchHlgtSameRdr" SearchTravRetHighlight(size[10],highlight[10],mergeContiguous[true],maxFrags[3],fields[body]) > : 1000

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

    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.