Enquire

Struct Enquire 

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

The primary interface to retrieve information from Xapian.

Used to perform searches, faceting, term iteration, expansion, sorting, relevancy and more.

Implementations§

Source§

impl Enquire

Source

pub fn new(db: impl AsRef<Database>) -> Self

Create a new Enquire instance associated with the given db

Source

pub fn add_matchspy<T: MatchSpy + Clone + 'static>(&mut self, spy: &T)

Attach a MatchSpy implementation to this Enquire

Instances of MatchSpy can be used to implement faceting

Source

pub fn eset<D: ExpandDecider + 'static>( &self, maxitems: u32, rset: impl AsRef<RSet>, flags: i32, decider: impl Into<Option<D>>, min_wt: f64, ) -> ESet

Retrieve the term expansion set for this Enquire

An ESet provides terms which may be relevant to the current query

Source

pub fn mset( &self, first: u32, maxitems: u32, atleast: impl Into<Option<u32>>, rset: impl Into<Option<RSet>>, ) -> MSet

Retrieve the MSet for the current Query with the default MatchDecider

Source

pub fn mset_with_decider( &self, first: u32, maxitems: u32, atleast: impl Into<Option<u32>>, rset: impl Into<Option<RSet>>, decider: impl MatchDecider + 'static, ) -> MSet

Retrieve the MSet for the current Query with a custom MatchDecider

Source

pub fn query(&self) -> Query

Retrieve the query currently associated with this Enquire instance

Source

pub fn set_query( &mut self, query: impl AsRef<Query>, qlen: impl Into<Option<u32>>, )

Set the query currently associated with this Enquire instance

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.