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
impl MultiQuery
Sourcepub unsafe fn as_raw(&self) -> *mut zvec_multi_query_t
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.
Sourcepub fn add_sub_query(&mut self, sub: &SubQuery) -> Result<()>
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.
Sourcepub fn sub_query_count(&self) -> usize
pub fn sub_query_count(&self) -> usize
Returns the number of sub-queries currently registered.
Sourcepub fn set_topk(&mut self, topk: i32) -> Result<()>
pub fn set_topk(&mut self, topk: i32) -> Result<()>
Sets the top-k parameter for the merged result.
Sourcepub fn set_filter(&mut self, filter: &str) -> Result<()>
pub fn set_filter(&mut self, filter: &str) -> Result<()>
Sets the filter expression applied to the final merged result.
Sourcepub fn set_include_vector(&mut self, include: bool) -> Result<()>
pub fn set_include_vector(&mut self, include: bool) -> Result<()>
Sets whether vector data is returned in the result documents.
Sourcepub fn include_vector(&self) -> bool
pub fn include_vector(&self) -> bool
Returns whether vector data is included in the result documents.
Sourcepub fn set_output_fields(&mut self, fields: &[&str]) -> Result<()>
pub fn set_output_fields(&mut self, fields: &[&str]) -> Result<()>
Sets the output field whitelist.
Sourcepub fn set_rerank_rrf(&mut self, rank_constant: i32) -> Result<()>
pub fn set_rerank_rrf(&mut self, rank_constant: i32) -> Result<()>
Configures Reciprocal Rank Fusion (RRF) as the rerank strategy.
Sourcepub fn set_rerank_weighted(&mut self, weights: &[f64]) -> Result<()>
pub fn set_rerank_weighted(&mut self, weights: &[f64]) -> Result<()>
Configures a weighted rerank strategy with the given per-sub-query weights.