Struct elasticsearch_dsl::search::highlight::DefaultHighlighter [−][src]
pub struct DefaultHighlighter { /* fields omitted */ }
Expand description
Highlighting settings can be set on a global level and overridden at the field level
Implementations
Creates a new Highlighter instance
A string that contains each boundary character. Defaults to .,!? \t\n
.
How far to scan for boundary characters. Defaults to 20
.
Highlight based on the source even if the field is stored separately. Defaults to false
.
The size of the highlighted fragment in characters. Defaults to
100
.
Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
Warning
Elasticsearch does not validate thathighlight_query
contains the search query in any way so it is possible to define it so legitimate query results are not highlighted. Generally, you should include the search query as part of thehighlight_query
.
The amount of text you want to return from the beginning of the field if there are no
matching fragments to highlight. Defaults to 0
(nothing is returned).
The maximum number of fragments to return. If the number of fragments is set to 0
, no
fragments are returned. Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but
fragmentation is not required. If number_of_fragments
is 0
, fragment_size
is ignored.
Defaults to 5
.
Sorts highlighted fragments by score when set to score
. By default,
fragments will be output in the order they appear in the field
(order: none
). Setting this option to score
will output
the most relevant fragments first. Each highlighter applies its own logic to compute
relevancy scores. See the document
How highlighters work internally
for more details how different highlighters find the best fragments.
By default, only fields that contains a query match are highlighted. Set
require_field_match
to false
to highlight all fields. Defaults to true
.
Set to styled
to use the built-in tag schema or use custom tags
Converts Highlighter to specific highlighter
Converts Highlighter to specific highlighter
Converts Highlighter to specific highlighter
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for DefaultHighlighter
impl Send for DefaultHighlighter
impl Sync for DefaultHighlighter
impl Unpin for DefaultHighlighter
impl UnwindSafe for DefaultHighlighter
Blanket Implementations
Mutably borrows from an owned value. Read more