pub struct Highlight {
pub field: String,
pub name: String,
pub fragment_number: usize,
pub fragment_size: usize,
pub highlight_markup: bool,
pub pre_tags: String,
pub post_tags: String,
}Expand description
Specifies the number and size of fragments (snippets, summaries) to generate from each specified field to provide a “keyword in context” (KWIC) functionality. With highlight_markup the matching query terms within the fragments can be highlighted with HTML markup.
Fields§
§field: StringSpecifies the field from which the fragments (snippets, summaries) are created.
name: StringAllows to specifiy multiple highlight result fields from the same source field, leaving the original field intact, Default: if name is empty then field is used instead, i.e the original field is overwritten with the highlight.
fragment_number: usizeIf 0/default then return the full original text without fragmenting.
fragment_size: usizeSpecifies the length of a highlight fragment. The default 0 returns the full original text without truncating, but still with highlighting if highlight_markup is enabled.
highlight_markup: boolif true, the matching query terms within the fragments are highlighted with HTML markup <b>term</b>.
Specifies the markup tags to insert before each highlighted term (e.g. "<b>" or "<em>"). This can be any string, but is most often an HTML or XML tag. Only used when highlight_markup is set to true.
Specifies the markup tags to insert after each highlighted term. (e.g. "</b>" or "</em>"). This can be any string, but is most often an HTML or XML tag. Only used when highlight_markup is set to true.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Highlight
impl<'de> Deserialize<'de> for Highlight
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Highlight, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Highlight, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Highlight
impl Serialize for Highlight
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more