Skip to main content

highlight

Function highlight 

Source
pub fn highlight(
    text: &str,
    query_terms: &[String],
    analyzer: Option<&Analyzer>,
    opts: &HighlightOptions,
) -> AnalysisResult<String>
Expand description

Wrap matched query terms in text with the configured tags.

analyzer is optional: when supplied, both the query terms and the source text are run through the same pipeline so stemming / lower-casing / accent folding agree. When omitted, ASCII lower-case is used instead.