Skip to main content

MultiQuery

Struct MultiQuery 

Source
pub struct MultiQuery { /* private fields */ }
Expand description

A multi-query operation combining multiple SubQuery objects.

Use MultiQuery::new to construct, then MultiQuery::add_sub_query to attach individual sub-queries. Configure top-k, filters, and rerank strategy before passing to crate::Collection::multi_query.

Implementations§

Source§

impl MultiQuery

Source

pub fn new() -> Result<Self>

Creates a new multi-query.

Source

pub unsafe fn as_raw(&self) -> *mut zvec_multi_query_t

Returns the raw FFI handle.

§Safety

The caller must not use the handle after the MultiQuery is dropped.

Source

pub fn add_sub_query(&mut self, sub: &SubQuery) -> Result<()>

Adds a sub-query to this multi-query.

The sub-query is copied internally; the caller retains ownership.

Source

pub fn sub_query_count(&self) -> usize

Returns the number of sub-queries currently registered.

Source

pub fn set_topk(&mut self, topk: i32) -> Result<()>

Sets the top-k parameter for the merged result.

Source

pub fn topk(&self) -> i32

Returns the configured top-k value.

Source

pub fn set_filter(&mut self, filter: &str) -> Result<()>

Sets the filter expression applied to the final merged result.

Source

pub fn set_include_vector(&mut self, include: bool) -> Result<()>

Sets whether vector data is returned in the result documents.

Source

pub fn include_vector(&self) -> bool

Returns whether vector data is included in the result documents.

Source

pub fn set_output_fields(&mut self, fields: &[&str]) -> Result<()>

Sets the output field whitelist.

Source

pub fn set_rerank_rrf(&mut self, rank_constant: i32) -> Result<()>

Configures Reciprocal Rank Fusion (RRF) as the rerank strategy.

Source

pub fn set_rerank_weighted(&mut self, weights: &[f64]) -> Result<()>

Configures a weighted rerank strategy with the given per-sub-query weights.

Trait Implementations§

Source§

impl Drop for MultiQuery

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for MultiQuery

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.