pub struct Highlight { /* private fields */ }Expand description
Match highlighting for a Search (the highlight block). Name the fields
to highlight and tune the tags / fragments; pass it to
Search::highlight.
Implementations§
Source§impl Highlight
impl Highlight
Sourcepub fn field(self, field: impl Into<String>) -> Self
pub fn field(self, field: impl Into<String>) -> Self
Highlight field with the default settings.
Sourcepub fn field_with(self, field: impl Into<String>, settings: Value) -> Self
pub fn field_with(self, field: impl Into<String>, settings: Value) -> Self
Highlight field with explicit per-field settings (e.g. a custom
fragment_size / matched_fields).
Tags wrapping each highlighted snippet’s start.
Tags wrapping each highlighted snippet’s end.
Sourcepub fn fragment_size(self, fragment_size: u32) -> Self
pub fn fragment_size(self, fragment_size: u32) -> Self
Character length of each highlighted fragment.
Sourcepub fn number_of_fragments(self, number_of_fragments: u32) -> Self
pub fn number_of_fragments(self, number_of_fragments: u32) -> Self
Maximum number of fragments returned per field.
Sourcepub fn require_field_match(self, require: bool) -> Self
pub fn require_field_match(self, require: bool) -> Self
Only highlight fields that the query matched (default true).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Highlight
impl RefUnwindSafe for Highlight
impl Send for Highlight
impl Sync for Highlight
impl Unpin for Highlight
impl UnsafeUnpin for Highlight
impl UnwindSafe for Highlight
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more