[−][src]Struct elasticlunr::IndexBuilder
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]
I: IntoIterator,
I::Item: AsRef<str>,
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
impl Sync for IndexBuilder
impl Unpin for IndexBuilder
impl Send for IndexBuilder
impl UnwindSafe for IndexBuilder
impl RefUnwindSafe for IndexBuilder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,