Struct pallet::search::IndexBuilder[][src]

pub struct IndexBuilder<T> { /* fields omitted */ }

Builder for an Index

Implementations

impl<T> IndexBuilder<T>[src]

pub fn with_index_dir<I: Into<PathBuf>>(mut self: Self, index_dir: I) -> Self[src]

Use the given directory (must exist) for the tantivy::Index.

pub fn with_writer_accessor<F>(mut self: Self, writer_accessor: F) -> Self where
    F: Fn(&Index) -> Result<IndexWriter> + Send + Sync + 'static, 
[src]

Define a custom way to get the tantivy::IndexWriter.

By default will use tantivy_index.writer(128_000_000).

pub fn with_config<F>(mut self: Self, config: F) -> Self where
    F: Fn(&mut Index) -> Result<()> + 'static, 
[src]

Custom configuration for the tantivy::Index.

By default will use tantivy_index.set_default_multithread_executor()?.

pub fn with_id_field_name<I: Into<String>>(
    mut self: Self,
    id_field_name: I
) -> Self
[src]

Set the field name to be used for the datastore id.

By default will use __id__.

pub fn with_fields_builder<F>(mut self: Self, fields_builder: F) -> Self where
    F: Fn(&mut SchemaBuilder) -> Result<T> + 'static, 
[src]

Handler that adds fields to a schema, and returns them in the fields container

pub fn with_default_search_fields_builder<F>(
    mut self: Self,
    default_search_fields_builder: F
) -> Self where
    F: Fn(&T) -> Vec<Field> + 'static, 
[src]

Given the fields container, return fields that should be used in default search.

pub fn finish(self) -> Result<Index<T>>[src]

Convert into finished Index

Trait Implementations

impl<T> Default for IndexBuilder<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for IndexBuilder<T>[src]

impl<T> !Send for IndexBuilder<T>[src]

impl<T> !Sync for IndexBuilder<T>[src]

impl<T> Unpin for IndexBuilder<T>[src]

impl<T> !UnwindSafe for IndexBuilder<T>[src]

Blanket Implementations

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

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

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

impl<T> Downcast for T where
    T: Any

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,