Struct elasticsearch_dsl::search::highlight::FastVectorHighlighter [−][src]
pub struct FastVectorHighlighter { /* fields omitted */ }
Expand description
The fvh
highlighter uses the Lucene Fast Vector highlighter. This highlighter can be used on
fields with term_vector
set to with_positions_offsets
in the mapping. The fast vector
highlighter:
- Can be customized with a boundary_scanner.
- Requires setting
term_vector
towith_positions_offsets
which increases the size of the index - Can combine matches from multiple fields into one result. See
matched_fields
- Can assign different weights to matches at different positions allowing for things like phrase matches being sorted above term matches when highlighting a Boosting Query that boosts phrase matches over term matches
Warning The
fvh
highlighter does not support span queries. If you need support for span queries, try an alternative highlighter, such as theunified
highlighter.
Implementations
Creates a new FastVectorHighlighter 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
Specifies how to break the highlighted fragments.
Controls the margin from which you want to start highlighting.
Combine matches on multiple fields to highlight a single field. This is most intuitive for
multi-fields 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 benefits from having store set to yes.
Controls the number of matching phrases in a document that are considered. Prevents the
highlighter from analyzing too many phrases and consuming too much memory. When using
matched_fields
, phrase_limit
phrases per matched field are considered. Raising the
limit increases query time and consumes more memory. Defaults to 256.
Trait Implementations
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 FastVectorHighlighter
impl Send for FastVectorHighlighter
impl Sync for FastVectorHighlighter
impl Unpin for FastVectorHighlighter
impl UnwindSafe for FastVectorHighlighter
Blanket Implementations
Mutably borrows from an owned value. Read more