Class HighlightDescriptor<T>
Inheritance
HighlightDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
public class HighlightDescriptor<T> : DescriptorBase<HighlightDescriptor<T>, IHighlight>, IDescriptor, IHighlight where T : class
Type Parameters
Methods
|
Edit this page
View Source
BoundaryChars(string)
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
public HighlightDescriptor<T> BoundaryChars(string boundaryChars)
Parameters
Type |
Name |
Description |
string |
boundaryChars |
|
Returns
|
Edit this page
View Source
BoundaryMaxScan(int?)
Controls how far to look for boundary characters. Defaults to 20.
Declaration
public HighlightDescriptor<T> BoundaryMaxScan(int? boundaryMaxScan)
Parameters
Type |
Name |
Description |
int? |
boundaryMaxScan |
|
Returns
|
Edit this page
View Source
BoundaryScanner(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
public HighlightDescriptor<T> BoundaryScanner(BoundaryScanner? boundaryScanner)
Parameters
Returns
|
Edit this page
View Source
BoundaryScannerLocale(string)
You can further specify boundary_scanner_locale to control which Locale is used to search the text for these boundaries.
Declaration
public HighlightDescriptor<T> BoundaryScannerLocale(string locale)
Parameters
Type |
Name |
Description |
string |
locale |
|
Returns
|
Edit this page
View Source
Encoder(HighlighterEncoder?)
Define how highlighted text will be encoded.
It can be either default (no encoding) or html (will escape html, if you use html highlighting tags).
Declaration
public HighlightDescriptor<T> Encoder(HighlighterEncoder? encoder)
Parameters
Returns
|
Edit this page
View Source
Fields(params Func<HighlightFieldDescriptor<T>, IHighlightField>[])
Declaration
public HighlightDescriptor<T> Fields(params Func<HighlightFieldDescriptor<T>, IHighlightField>[] fieldHighlighters)
Parameters
Returns
|
Edit this page
View Source
FragmentOffset(int?)
Controls the margin to start highlighting from when using the fast vector highlighter
Declaration
public HighlightDescriptor<T> FragmentOffset(int? fragmentOffset)
Parameters
Type |
Name |
Description |
int? |
fragmentOffset |
|
Returns
|
Edit this page
View Source
FragmentSize(int?)
The size of the highlighted fragment, in characters. Defaults to 100
Declaration
public HighlightDescriptor<T> FragmentSize(int? fragmentSize)
Parameters
Type |
Name |
Description |
int? |
fragmentSize |
|
Returns
|
Edit this page
View Source
Fragmenter(HighlighterFragmenter?)
Fragmenter can control how text should be broken up in highlight snippets. However, this option is
applicable only for the Plain Highlighter
Declaration
public HighlightDescriptor<T> Fragmenter(HighlighterFragmenter? fragmenter)
Parameters
Returns
|
Edit this page
View Source
HighlightQuery(Func<QueryContainerDescriptor<T>, QueryContainer>)
The query to use for highlighting
Declaration
public HighlightDescriptor<T> HighlightQuery(Func<QueryContainerDescriptor<T>, QueryContainer> query)
Parameters
Returns
|
Edit this page
View Source
MaxAnalyzerOffset(int?)
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
public HighlightDescriptor<T> MaxAnalyzerOffset(int? maxAnalyzerOffset)
Parameters
Type |
Name |
Description |
int? |
maxAnalyzerOffset |
|
Returns
|
Edit this page
View Source
MaxFragmentLength(int?)
Declaration
public HighlightDescriptor<T> MaxFragmentLength(int? maxFragmentLength)
Parameters
Type |
Name |
Description |
int? |
maxFragmentLength |
|
Returns
|
Edit this page
View Source
NoMatchSize(int?)
In the case where there is no matching fragment to highlight, the default is to not return anything. Instead, we can return a snippet of
text from
the beginning of the field by setting no_match_size (default 0) to the length of the text that you want returned. The actual length may be
shorter or longer than specified as it tries to break on a word boundary.
Declaration
public HighlightDescriptor<T> NoMatchSize(int? noMatchSize)
Parameters
Type |
Name |
Description |
int? |
noMatchSize |
|
Returns
|
Edit this page
View Source
NumberOfFragments(int?)
The maximum number of fragments to return. Defaults to 5.
Declaration
public HighlightDescriptor<T> NumberOfFragments(int? numberOfFragments)
Parameters
Type |
Name |
Description |
int? |
numberOfFragments |
|
Returns
|
Edit this page
View Source
Order(HighlighterOrder?)
The order in which highlighted fragments are sorted
Declaration
public HighlightDescriptor<T> Order(HighlighterOrder? order)
Parameters
Returns
|
Edit this page
View Source
PostTags(IEnumerable<string>)
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
public HighlightDescriptor<T> PostTags(IEnumerable<string> postTags)
Parameters
Returns
|
Edit this page
View Source
PostTags(params string[])
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
public HighlightDescriptor<T> PostTags(params string[] postTags)
Parameters
Type |
Name |
Description |
string[] |
postTags |
|
Returns
|
Edit this page
View Source
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
public HighlightDescriptor<T> PreTags(IEnumerable<string> preTags)
Parameters
Returns
|
Edit this page
View Source
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
public HighlightDescriptor<T> PreTags(params string[] preTags)
Parameters
Type |
Name |
Description |
string[] |
preTags |
|
Returns
|
Edit this page
View Source
RequireFieldMatch(bool?)
Use a specific "tag" schemas.
Declaration
public HighlightDescriptor<T> RequireFieldMatch(bool? requireFieldMatch = true)
Parameters
Type |
Name |
Description |
bool? |
requireFieldMatch |
|
Returns
|
Edit this page
View Source
Use a specific "tag" schemas.
Declaration
public HighlightDescriptor<T> TagsSchema(HighlighterTagsSchema? schema)
Parameters
Returns
Implements
Extension Methods