#[repr(i32)]
pub enum SnippetFlags {
    SNIPPET_BACKGROUND_MODEL,
    SNIPPET_EXHAUSTIVE,
    SNIPPET_EMPTY_WITHOUT_MATCH,
    SNIPPET_CJK_NGRAM,
}

Variants§

§

SNIPPET_BACKGROUND_MODEL

Model the relevancy of non-query terms in MSet::snippet().

Non-query terms will be assigned a small weight, and the snippet will tend to prefer snippets which contain a more interesting background (where the query term content is equivalent).

§

SNIPPET_EXHAUSTIVE

Exhaustively evaluate candidate snippets in MSet::snippet().

Without this flag, snippet generation will stop once it thinks it has found a “good enough” snippet, which will generally reduce the time taken to generate a snippet.

§

SNIPPET_EMPTY_WITHOUT_MATCH

Return the empty string if no term got matched.

If enabled, snippet() returns an empty string if not a single match was found in text. If not enabled, snippet() returns a (sub)string of text without any highlighted terms.

§

SNIPPET_CJK_NGRAM

Enable generation of n-grams from CJK text.

This option highlights CJK searches made using the QueryParser FLAG_CJK_NGRAM flag. Non-CJK characters are split into words as normal.

The TermGenerator FLAG_CJK_NGRAM flag needs to have been used at index time.

This mode can also be enabled by setting environment variable XAPIAN_CJK_NGRAM to a non-empty value (but doing so was deprecated in 1.4.11).

@since Added in Xapian 1.4.11.

Trait Implementations§

source§

impl Debug for SnippetFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.