Struct perlin::index::boolean_index::IndexBuilder
[−]
[src]
pub struct IndexBuilder<TTerm, TStorage> { /* fields omitted */ }
IndexBuilder
is used to build BooleanIndex
instances
Methods
impl<TTerm, TStorage> IndexBuilder<TTerm, TStorage> where
TTerm: Ord,
TStorage: Storage<Vec<(u64, Vec<u32>)>>,
[src]
TTerm: Ord,
TStorage: Storage<Vec<(u64, Vec<u32>)>>,
fn new() -> Self
Creates a new instance of IndexBuilder
impl<TTerm, TStorage> IndexBuilder<TTerm, TStorage> where
TTerm: Ord,
TStorage: Storage<Vec<(u64, Vec<u32>)>> + Volatile + 'static,
[src]
TTerm: Ord,
TStorage: Storage<Vec<(u64, Vec<u32>)>> + Volatile + 'static,
fn create<TCollection, TDoc>(
&self,
documents: TCollection
) -> Result<BooleanIndex<TTerm>> where
TCollection: Iterator<Item = TDoc>,
TDoc: Iterator<Item = TTerm>,
&self,
documents: TCollection
) -> Result<BooleanIndex<TTerm>> where
TCollection: Iterator<Item = TDoc>,
TDoc: Iterator<Item = TTerm>,
Creates a volatile instance of BooleanIndex
At the moment BooleanIndex
does not support adding or removing
documents from the index.
So all index which should be indexed need to be passed to this method
impl<TTerm, TStorage> IndexBuilder<TTerm, TStorage> where
TTerm: Ord + ByteDecodable + ByteEncodable,
TStorage: Storage<Vec<(u64, Vec<u32>)>> + Persistent + 'static,
[src]
TTerm: Ord + ByteDecodable + ByteEncodable,
TStorage: Storage<Vec<(u64, Vec<u32>)>> + Persistent + 'static,
fn persist(self, at: &Path) -> Self
Enables a persistent index at the passed path.
at
must be either a prefilled directory if the load
method is to be
called
or an empty directory if a new index is created with
create_persistence
fn create_persistent<TDocsIterator, TDocIterator>(
&self,
documents: TDocsIterator
) -> Result<BooleanIndex<TTerm>> where
TDocsIterator: Iterator<Item = TDocIterator>,
TDocIterator: Iterator<Item = TTerm>,
&self,
documents: TDocsIterator
) -> Result<BooleanIndex<TTerm>> where
TDocsIterator: Iterator<Item = TDocIterator>,
TDocIterator: Iterator<Item = TTerm>,
A new index is created and saved in the directory passed to the
persist
method
Returns a BuilderError
if persist
was not called or if directory is
not empty
fn load(&self) -> Result<BooleanIndex<TTerm>>
Loads an index from a previously filled directory.
Returns a BuilderError
if directory is empty or does not contain
valid data