Enum xapian::constants::SnippetFlags
source · #[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.