Class SearchTravRetHighlightTask
Search and Traverse and Retrieve docs task. Highlight the fields in the retrieved documents.
Implements
Inherited Members
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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
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 size | The number of hits to traverse, otherwise all will be traversed. |
highlight | The number of the hits to highlight. Will always be less than or equal to traversal size. Default is MaxValue (i.e. hits.Length). |
maxFrags | The maximum number of fragments to score by the highlighter. |
mergeContiguous | true if contiguous fragments should be merged. |
fields | The fields to highlight. If not specified all fields will be highlighted (or at least attempted). |
"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.