Struct TermGenerator

Source
pub struct TermGenerator(/* private fields */);
Expand description

An instance of a Xapian TermGenerator, which can be used to index text with optional stemming

Implementations§

Source§

impl TermGenerator

Source

pub fn increase_termpos(&mut self, delta: impl Into<Option<u32>>)

Increase the term position used when indexing index_text

Useful to keep phrases from spanning logically separate regions of text

Source

pub fn index_text<T>( &mut self, text: impl AsRef<str>, increment: impl Into<Option<u32>>, prefix: impl Into<Option<T>>, )
where T: AsRef<str> + Default,

Index some text

The within-document-frequency for the text will be increased by increment (or 1 if None) If provided, the text will be prefixed with prefix

Source

pub fn set_database(&mut self, db: impl AsRef<WritableDatabase>)

Set the currently active database

Source

pub fn set_document(&mut self, doc: impl AsRef<Document>)

Set the currently active document

Source

pub fn set_stemmer(&mut self, stem: impl AsRef<Stem>)

Set the stemmer to be used when indexing text

Source

pub fn set_stemming_strategy( &mut self, strategy: impl Into<TermGenerator_stem_strategy>, )

Set the stemming strategy to be used when indexing text

Source

pub fn set_stopper<T: Stopper + 'static>( &mut self, stopper: impl Into<Option<T>>, )

Set the stopper to be used when indexing text

Source

pub fn set_stopper_strategy( &mut self, strategy: impl Into<TermGenerator_stop_strategy>, )

Set the stopper strategy to be used when indexing text

Trait Implementations§

Source§

impl Default for TermGenerator

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.