Struct elasticlunr::IndexBuilder
[−]
[src]
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
.
pub fn add_fields<I>(self, fields: I) -> Self where
I: IntoIterator,
I::Item: AsRef<str>,
[src]
I: IntoIterator,
I::Item: AsRef<str>,
Add the document fields to the Index
.
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.