Trait elastic_types::boolean::mapping::BooleanMapping [] [src]

pub trait BooleanMapping where
    Self: Default
{ fn boost() -> Option<f32> { ... }
fn doc_values() -> Option<bool> { ... }
fn index() -> Option<bool> { ... }
fn null_value() -> Option<bool> { ... }
fn store() -> Option<bool> { ... } }

The base requirements for mapping a boolean type.

Custom mappings can be defined by implementing BooleanMapping.

Examples

Define a custom BooleanMapping:

#[derive(Default)]
struct MyBooleanMapping;
impl BooleanMapping for MyBooleanMapping {
    //Overload the mapping functions here
    fn boost() -> Option<f32> {
        Some(1.5)
    }
}

This will produce the following mapping:

{
    "type": "boolean",
    "boost": 1.5
}

Provided Methods

Field-level index time boosting. Accepts a floating point number, defaults to 1.0.

Should the field be stored on disk in a column-stride fashion, so that it can later be used for sorting, aggregations, or scripting? Accepts true (default) or false.

Should the field be searchable? Accepts not_analyzed (default) and no.

Accepts a string value which is substituted for any explicit null values. Defaults to null, which means the field is treated as missing.

Whether the field value should be stored and retrievable separately from the _source field. Accepts true or false (default).

Implementors