Interface IHighlightField
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public interface IHighlightField
Properties
| Edit this page View SourceBoundaryChars
Defines what constitutes a boundary for highlighting when using the fast vector highlighter. It's a single string with each boundary character defined in it. It defaults to .,!? \t\n.
Declaration
[DataMember(Name = "boundary_chars")]
string BoundaryChars { get; set; }
Property Value
Type | Description |
---|---|
string |
BoundaryMaxScan
Controls how far to look for boundary characters. Defaults to 20.
Declaration
[DataMember(Name = "boundary_max_scan")]
int? BoundaryMaxScan { get; set; }
Property Value
Type | Description |
---|---|
int? |
BoundaryScanner
When highlighting a field using the unified highlighter or the fast vector highlighter, you can specify how to break the highlighted fragments using boundary_scanner
Declaration
[DataMember(Name = "boundary_scanner")]
BoundaryScanner? BoundaryScanner { get; set; }
Property Value
Type | Description |
---|---|
BoundaryScanner? |
BoundaryScannerLocale
You can further specify boundary_scanner_locale to control which Locale is used to search the text for these boundaries.
Declaration
[DataMember(Name = "boundary_scanner_locale")]
string BoundaryScannerLocale { get; set; }
Property Value
Type | Description |
---|---|
string |
Field
The field on which to perform highlighting.
Declaration
Field Field { get; set; }
Property Value
Type | Description |
---|---|
Field |
Remarks
In order to perform highlighting, the actual content of the field is required. If the field in question is stored (has store set to true in the mapping) it will be used, otherwise, the actual _source will be loaded and the relevant field will be extracted from it.
ForceSource
Forces the highlighting to highlight fields based on the source even if fields are stored separately.
Declaration
[DataMember(Name = "force_source")]
bool? ForceSource { get; set; }
Property Value
Type | Description |
---|---|
bool? |
FragmentOffset
Controls the margin to start highlighting from when using the fast vector highlighter
Declaration
[DataMember(Name = "fragment_offset")]
int? FragmentOffset { get; set; }
Property Value
Type | Description |
---|---|
int? |
FragmentSize
The size of the highlighted fragment, in characters. Defaults to 100
Declaration
[DataMember(Name = "fragment_size")]
int? FragmentSize { get; set; }
Property Value
Type | Description |
---|---|
int? |
Fragmenter
Fragmenter can control how text should be broken up in highlight snippets. However, this option is applicable only for the Plain Highlighter
Declaration
[DataMember(Name = "fragmenter")]
HighlighterFragmenter? Fragmenter { get; set; }
Property Value
Type | Description |
---|---|
HighlighterFragmenter? |
HighlightQuery
The query to use for highlighting
Declaration
[DataMember(Name = "highlight_query")]
QueryContainer HighlightQuery { get; set; }
Property Value
Type | Description |
---|---|
QueryContainer |
MatchedFields
Combine matches on multiple fields to highlight a single field when using the fast vector highighter. This is most intuitive for multifields that analyze the same string in different ways. All matched fields must have term_vector set to with_positions_offsets, but only the field to which the matches are combined is loaded so only that field would benefit from having store set to yes.
Declaration
[DataMember(Name = "matched_fields")]
Fields MatchedFields { get; set; }
Property Value
Type | Description |
---|---|
Fields |
MaxAnalyzerOffset
If this setting is set to a non-negative value, the highlighting stops at this defined maximum limit, and the rest of the text is not processed, thus not highlighted and no error is returned.
Declaration
[DataMember(Name = "max_analyzer_offset")]
int? MaxAnalyzerOffset { get; set; }
Property Value
Type | Description |
---|---|
int? |
Remarks
Introduced in OpenSearch 2.2
MaxFragmentLength
Declaration
[DataMember(Name = "max_fragment_length")]
int? MaxFragmentLength { get; set; }
Property Value
Type | Description |
---|---|
int? |
NoMatchSize
The length of a snippet of text from the beginning of the field to return when no match for highlighting is found. Default behaviour is to not return anything when a match is not found. The actual length may be shorter than specified as it tries to break on a word boundary.
Declaration
[DataMember(Name = "no_match_size")]
int? NoMatchSize { get; set; }
Property Value
Type | Description |
---|---|
int? |
NumberOfFragments
The maximum number of fragments to return. Defaults to 5.
Declaration
[DataMember(Name = "number_of_fragments")]
int? NumberOfFragments { get; set; }
Property Value
Type | Description |
---|---|
int? |
Order
The order in which highlighted fragments are sorted. Only valid for the unified highlighter.
Declaration
[DataMember(Name = "order")]
HighlighterOrder? Order { get; set; }
Property Value
Type | Description |
---|---|
HighlighterOrder? |
PhraseLimit
Controls the number of matching phrases in a document that are considered. Prevents the Fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, PhraseLimit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the Fvh highlighter. Defaults to 256.
Declaration
[DataMember(Name = "phrase_limit")]
int? PhraseLimit { get; set; }
Property Value
Type | Description |
---|---|
int? |
PostTags
Controls the post tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.
Declaration
[DataMember(Name = "post_tags")]
IEnumerable<string> PostTags { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
PreTags
Controls the pre tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.
Declaration
[DataMember(Name = "pre_tags")]
IEnumerable<string> PreTags { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
RequireFieldMatch
Determines if only fields that hold a query match will be highlighted. Set to false
will cause any field to be highlighted regardless of whether the query matched specifically on them. Default behaviour
is true
.
Declaration
[DataMember(Name = "require_field_match")]
bool? RequireFieldMatch { get; set; }
Property Value
Type | Description |
---|---|
bool? |
TagsSchema
Use a specific "tag" schemas.
Declaration
[DataMember(Name = "tags_schema")]
HighlighterTagsSchema? TagsSchema { get; set; }
Property Value
Type | Description |
---|---|
HighlighterTagsSchema? |
Remarks
Currently a single schema called "styled" with the following pre_tags: <em class="hlt1">, <em class="hlt2">, <em class="hlt3">, <em class="hlt4">, <em class="hlt5">, <em class="hlt6">, <em class="hlt7">, <em class="hlt8">, <em class="hlt9">, <em class="hlt10">
Type
The type of highlighter to use. Can be a defined or custom highlighter
Declaration
[DataMember(Name = "type")]
Union<HighlighterType, string> Type { get; set; }
Property Value
Type | Description |
---|---|
Union<HighlighterType, string> |