[][src]Struct elasticlunr::IndexBuilder

pub struct IndexBuilder { /* fields omitted */ }

A builder for an Index with custom parameters.

Example

let mut index = IndexBuilder::new()
    .save_docs(false)
    .add_fields(&["title", "subtitle", "body"])
    .set_ref("doc_id")
    .build();
index.add_doc("doc_a", &["Chapter 1", "Welcome to Copenhagen", "..."]);

Methods

impl IndexBuilder[src]

pub fn new() -> Self[src]

pub fn save_docs(self, save: bool) -> Self[src]

Set whether or not documents should be saved in the Index's document store.

pub fn add_field(self, field: &str) -> Self[src]

Add a document field to the Index.

If the Index already contains a field with an identical name, adding it again is a no-op.

pub fn add_fields<I>(self, fields: I) -> Self where
    I: IntoIterator,
    I::Item: AsRef<str>, 
[src]

Add the document fields to the Index.

If the Index already contains a field with an identical name, adding it again is a no-op.

pub fn set_ref(self, ref_field: &str) -> Self[src]

Set the key used to store the document reference field.

pub fn set_pipeline(self, pipeline: Pipeline) -> Self[src]

Set the pipeline used by the Index.

pub fn build(self) -> Index[src]

Build an Index from this builder.

Trait Implementations

impl Default for IndexBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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]