pub struct Simple { /* private fields */ }
Implementations§
source§impl Simple
impl Simple
sourcepub fn new(
proximity_threshold: f32,
proximity_algorithm: Algorithm,
word_count_limit: usize,
) -> Self
pub fn new( proximity_threshold: f32, proximity_algorithm: Algorithm, word_count_limit: usize, ) -> Self
proximity_threshold
is the threshold where alike words are also accepted.
It uses the range [0..1], where values nearer 0 allow more words.
The default is 0.9
.
proximity_threshold
is the algorithm used for proximity checking of words.
word_count_limit
is the number of words in this index where only words with the first
character is used for approximate matching.
Default is 2_500
.
Trait Implementations§
source§impl<'a> Provider<'a> for Simple
impl<'a> Provider<'a> for Simple
source§fn remove_document(&mut self, document: Id)
fn remove_document(&mut self, document: Id)
O(n log n)
source§fn documents_with_word(
&'a self,
word: impl AsRef<str>,
) -> Option<Self::DocumentIter>
fn documents_with_word( &'a self, word: impl AsRef<str>, ) -> Option<Self::DocumentIter>
O(log n)
Iterator is O(1) - running this and consuming the iterator is O(n log n).
You can get the length of the list using the ExactSizeIterator
trait.
type DocumentIter = Copied<Iter<'a, Id>>
type WordIter = Keys<'a, Arc<Alphanumeral<StrPtr>>, SimpleDocMap>
type WordFilteredIter = Map<Range<'a, Arc<Alphanumeral<StrPtr>>, SimpleDocMap>, fn(_: (&'a Arc<Alphanumeral<StrPtr>>, &'a SimpleDocMap)) -> &'a Arc<Alphanumeral<StrPtr>>>
source§fn size(&self) -> usize
fn size(&self) -> usize
Estimate of the number of bytes this index uses in memory,
specifically the heap. Read more
fn word_count_upper_limit(&self) -> usize
source§fn word_count_limit(&self) -> usize
fn word_count_limit(&self) -> usize
The limit of
Self::word_count_upper_limit
where Self::words_starting_with
is used
instead of Self::words
.fn words(&'a self) -> Self::WordIter
fn words_starting_with(&'a self, c: char) -> Self::WordFilteredIter
fn word_proximity_threshold(&self) -> f32
fn word_proximity_algorithm(&self) -> Algorithm
source§fn digest_document(&mut self, id: Id, content: &str)
fn digest_document(&mut self, id: Id, content: &str)
Only adds words which are alphanumeric.
Auto Trait Implementations§
impl Freeze for Simple
impl RefUnwindSafe for Simple
impl Send for Simple
impl Sync for Simple
impl Unpin for Simple
impl UnwindSafe for Simple
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more