org.apache.lucene.benchmark.byTask.tasks

## Class SearchTravRetHighlightTask

- java.lang.Object
- - org.apache.lucene.benchmark.byTask.tasks.PerfTask
  - - org.apache.lucene.benchmark.byTask.tasks.ReadTask
    - - org.apache.lucene.benchmark.byTask.tasks.SearchTravTask
      - - org.apache.lucene.benchmark.byTask.tasks.SearchTravRetHighlightTask

- All Implemented Interfaces:
    Cloneable

      public class SearchTravRetHighlightTask
      extends SearchTravTask

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

  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: type[<enum>],maxFrags[<int>],fields[name1;name2;...]

  - type - the highlighter implementation, e.g. "UH"
  - maxFrags - The maximum number of fragments to score by the highlighter
  - fields - The fields to highlight. If not specified all fields will be highlighted (or at least attempted)
  Example:

      "SearchHlgtSameRdr" SearchTravRetHighlight(type[UH],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, and offsets in postings is another option.

  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.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.SearchTravTask

      `traversalSize`

    - ### Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

      `logStep, NEW_LINE, params, stopNow`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchTravRetHighlightTask(PerfRunData runData)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setParams(String params)` Set the params of this task.
    `void` | `setup()` Task setup work that should not be measured for that specific task.
    `protected int` | `withTopDocs(IndexSearcher searcher, Query q, TopDocs hits)`

    - ### Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.SearchTravTask

      `getQueryMaker, supportsParams, traversalSize, withRetrieve, withSearch, withTraverse, withWarm`

    - ### Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.ReadTask

      `createCollector, doLogic, getSort, numHits, retrieveDoc, withCollector, withMaxScore, withScore, withTotalHits`

    - ### Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

      `clone, close, getAlgLineNum, getBackgroundDeltaPriority, getDepth, getLogMessage, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setAlgLineNum, setDepth, setDisableCounting, setName, setRunInBackground, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, tearDown, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SearchTravRetHighlightTask

          public SearchTravRetHighlightTask(PerfRunData runData)

  - ### Method Detail

    - #### setParams

          public void setParams(String params)

      Description copied from class: `PerfTask`
      Set the params of this task.
      Overrides:
        `setParams` in class `SearchTravTask`

    - #### setup

          public void setup()
                     throws Exception

      Description copied from class: `PerfTask`
      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 `PerfTask.doLogic()` to this method. Only the work done in `PerfTask.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.
      Overrides:
        `setup` in class `ReadTask`
      Throws:
        `Exception`

    - #### withTopDocs

          protected int withTopDocs(IndexSearcher searcher,
                                    Query q,
                                    TopDocs hits)
                             throws Exception

      Overrides:
        `withTopDocs` in class `ReadTask`
      Throws:
        `Exception`

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.