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
impl TermGenerator
Sourcepub fn increase_termpos(&mut self, delta: impl Into<Option<u32>>)
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
Sourcepub fn index_text<T>(
&mut self,
text: impl AsRef<str>,
increment: impl Into<Option<u32>>,
prefix: impl Into<Option<T>>,
)
pub fn index_text<T>( &mut self, text: impl AsRef<str>, increment: impl Into<Option<u32>>, prefix: impl Into<Option<T>>, )
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
Sourcepub fn set_database(&mut self, db: impl AsRef<WritableDatabase>)
pub fn set_database(&mut self, db: impl AsRef<WritableDatabase>)
Set the currently active database
Sourcepub fn set_document(&mut self, doc: impl AsRef<Document>)
pub fn set_document(&mut self, doc: impl AsRef<Document>)
Set the currently active document
Sourcepub fn set_stemmer(&mut self, stem: impl AsRef<Stem>)
pub fn set_stemmer(&mut self, stem: impl AsRef<Stem>)
Set the stemmer to be used when indexing text
Sourcepub fn set_stemming_strategy(
&mut self,
strategy: impl Into<TermGenerator_stem_strategy>,
)
pub fn set_stemming_strategy( &mut self, strategy: impl Into<TermGenerator_stem_strategy>, )
Set the stemming strategy to be used when indexing text
Sourcepub fn set_stopper<T: Stopper + 'static>(
&mut self,
stopper: impl Into<Option<T>>,
)
pub fn set_stopper<T: Stopper + 'static>( &mut self, stopper: impl Into<Option<T>>, )
Set the stopper to be used when indexing text
Sourcepub fn set_stopper_strategy(
&mut self,
strategy: impl Into<TermGenerator_stop_strategy>,
)
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§
Auto Trait Implementations§
impl Freeze for TermGenerator
impl !RefUnwindSafe for TermGenerator
impl !Send for TermGenerator
impl !Sync for TermGenerator
impl Unpin for TermGenerator
impl UnwindSafe for TermGenerator
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