Struct MSet

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

A list of search results with associated metadata

Implementations§

Source§

impl MSet

Source

pub fn convert_to_percent(&self, weight: f64) -> i32

Convert a weight to a percentage, taking into account weighted query terms

Source

pub fn empty(&self) -> bool

Detects whether this MSet is empty

Source

pub fn matches(&self) -> MSetIter<'_>

Retrieve the iterator of Match objects for this MSet

Source

pub fn size(&self) -> u32

The number of matches in this MSet

Source

pub fn snippet<T, U, V>( &self, text: impl AsRef<str>, length: usize, stemmer: impl AsRef<Stem>, flags: u32, hl: impl Into<Option<(T, U)>>, omit: impl Into<Option<V>>, ) -> String
where T: AsRef<str> + Default, U: AsRef<str> + Default, V: AsRef<str> + Default,

Generate a snippet from the provided text

length controls the size of the snippet stemmer should be an instance of the same stemming algorithm used to build the query flags are used to control specific bits of functionality hl is an optional pair of string-likes used to highlight matches within the snippet, for use in markup omit is used to indicate any truncated prefix or suffix mid-sen

Source

pub fn termfreq(&self, term: impl AsRef<str>) -> u32

Get the number of documents which term occurs in

Auto Trait Implementations§

§

impl Freeze for MSet

§

impl !RefUnwindSafe for MSet

§

impl !Send for MSet

§

impl !Sync for MSet

§

impl Unpin for MSet

§

impl UnwindSafe for MSet

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.