Struct elipdotter::index::Simple

source ·
pub struct Simple { /* private fields */ }

Implementations§

source§

impl Simple

source

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.

source

pub fn ingest(&mut self, other: Self)

Merges other with self.

Trait Implementations§

source§

impl Debug for Simple

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Simple

Self::new with proximity_threshold set to 0.85.

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a> Provider<'a> for Simple

source§

fn insert_word(&mut self, word: impl AsRef<str>, document: Id, _index: usize)

O(log n log n)

source§

fn remove_document(&mut self, document: Id)

O(n log n)

source§

fn contains_word(&self, word: impl AsRef<str>, document: Id) -> bool

O(log n log n)

source§

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

Estimate of the number of bytes this index uses in memory, specifically the heap. Read more
source§

fn word_count_upper_limit(&self) -> usize

source§

fn word_count_limit(&self) -> usize

source§

fn words(&'a self) -> Self::WordIter

source§

fn words_starting_with(&'a self, c: char) -> Self::WordFilteredIter

source§

fn word_proximity_threshold(&self) -> f32

source§

fn word_proximity_algorithm(&self) -> Algorithm

source§

fn digest_document(&mut self, id: Id, content: &str)

Only adds words which are alphanumeric.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.