Struct SearchContext

Source
pub struct SearchContext<'ctx> {
    pub index: &'ctx Index,
    pub txn: &'ctx RoTxn<'ctx>,
    pub db_cache: DatabaseCache<'ctx>,
    pub word_interner: DedupInterner<String>,
    pub phrase_interner: DedupInterner<Phrase>,
    pub term_interner: Interner<QueryTerm>,
    pub phrase_docids: PhraseDocIdsCache,
    pub restricted_fids: Option<RestrictedFids>,
    pub prefix_search: PrefixSearch,
    pub vector_store_stats: Option<VectorStoreStats>,
}
Expand description

A structure used throughout the execution of a search query.

Fields§

§index: &'ctx Index§txn: &'ctx RoTxn<'ctx>§db_cache: DatabaseCache<'ctx>§word_interner: DedupInterner<String>§phrase_interner: DedupInterner<Phrase>§term_interner: Interner<QueryTerm>§phrase_docids: PhraseDocIdsCache§restricted_fids: Option<RestrictedFids>§prefix_search: PrefixSearch§vector_store_stats: Option<VectorStoreStats>

Implementations§

Source§

impl<'ctx> SearchContext<'ctx>

Source

pub fn get_words_fst(&mut self) -> Result<Set<Cow<'ctx, [u8]>>>

Source

pub fn word_docids( &mut self, universe: Option<&RoaringBitmap>, word: Word, ) -> Result<Option<RoaringBitmap>>

Source

pub fn word_prefix_docids( &mut self, universe: Option<&RoaringBitmap>, prefix: Word, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_pair_proximity_docids( &mut self, universe: Option<&RoaringBitmap>, word1: Interned<String>, word2: Interned<String>, proximity: u8, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_pair_proximity_docids_len( &mut self, universe: Option<&RoaringBitmap>, word1: Interned<String>, word2: Interned<String>, proximity: u8, ) -> Result<Option<u64>>

Source

pub fn get_db_word_prefix_pair_proximity_docids( &mut self, universe: Option<&RoaringBitmap>, word1: Interned<String>, prefix2: Interned<String>, proximity: u8, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_prefix_word_pair_proximity_docids( &mut self, universe: Option<&RoaringBitmap>, left_prefix: Interned<String>, right: Interned<String>, proximity: u8, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_fid_docids( &mut self, universe: Option<&RoaringBitmap>, word: Interned<String>, fid: u16, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_prefix_fid_docids( &mut self, universe: Option<&RoaringBitmap>, word_prefix: Interned<String>, fid: u16, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_fids(&mut self, word: Interned<String>) -> Result<Vec<u16>>

Source

pub fn get_db_word_prefix_fids( &mut self, word_prefix: Interned<String>, ) -> Result<Vec<u16>>

Source

pub fn get_db_word_position_docids( &mut self, universe: Option<&RoaringBitmap>, word: Interned<String>, position: u16, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_prefix_position_docids( &mut self, universe: Option<&RoaringBitmap>, word_prefix: Interned<String>, position: u16, ) -> Result<Option<RoaringBitmap>>

Source

pub fn get_db_word_positions( &mut self, word: Interned<String>, ) -> Result<Vec<u16>>

Source

pub fn get_db_word_prefix_positions( &mut self, word_prefix: Interned<String>, ) -> Result<Vec<u16>>

Source§

impl SearchContext<'_>

Source

pub fn get_phrase_docids( &mut self, phrase: Interned<Phrase>, ) -> Result<&RoaringBitmap>

Get the document ids associated with the given phrase

Source§

impl<'ctx> SearchContext<'ctx>

Source

pub fn new(index: &'ctx Index, txn: &'ctx RoTxn<'ctx>) -> Result<Self>

Source

pub fn is_prefix_search_allowed(&self) -> bool

Source

pub fn attributes_to_search_on( &mut self, attributes_to_search_on: &'ctx [String], ) -> Result<()>

Auto Trait Implementations§

§

impl<'ctx> Freeze for SearchContext<'ctx>

§

impl<'ctx> RefUnwindSafe for SearchContext<'ctx>

§

impl<'ctx> !Send for SearchContext<'ctx>

§

impl<'ctx> !Sync for SearchContext<'ctx>

§

impl<'ctx> Unpin for SearchContext<'ctx>

§

impl<'ctx> UnwindSafe for SearchContext<'ctx>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ErasedDestructor for T
where T: 'static,