[][src]Struct rs_es::operations::search::highlight::Highlight

pub struct Highlight {
    pub fields: HashMap<String, Setting>,
    pub pre_tags: Option<Vec<String>>,
    pub post_tags: Option<Vec<String>>,
    pub encoder: Option<Encoders>,
}

Fields

fields: HashMap<String, Setting>pre_tags: Option<Vec<String>>post_tags: Option<Vec<String>>encoder: Option<Encoders>

Methods

impl Highlight[src]

pub fn new() -> Highlight[src]

Create an Highlight entity without any field or setting specified as they are supposed to be added via the add method.

Examples

use rs_es::operations::search::highlight::{Highlight, Setting, SettingTypes, Encoders};

let mut highlight = Highlight::new().with_encoder(Encoders::HTML).to_owned();
let setting = Setting::new().with_type(SettingTypes::Plain).to_owned();
highlight.add_setting("first_name".to_owned(), setting);

pub fn with_encoder(&mut self, encoder: Encoders) -> &mut Highlight[src]

pub fn with_pre_tags(&mut self, pre_tags: Vec<String>) -> &mut Highlight[src]

pub fn with_post_tags(&mut self, post_tags: Vec<String>) -> &mut Highlight[src]

pub fn add_setting(&mut self, name: String, setting: Setting)[src]

Add a field to highlight to the set

Trait Implementations

impl Default for Highlight[src]

impl Clone for Highlight[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Highlight[src]

impl Serialize for Highlight[src]

Auto Trait Implementations

impl Send for Highlight

impl Sync for Highlight

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

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

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