pub struct SubQuery { /* private fields */ }Expand description
A sub-query inside a MultiQuery.
Each sub-query targets a single vector or sparse-vector field.
Implementations§
Source§impl SubQuery
impl SubQuery
Sourcepub unsafe fn as_raw(&self) -> *mut zvec_sub_query_t
pub unsafe fn as_raw(&self) -> *mut zvec_sub_query_t
Returns the raw FFI handle.
§Safety
The caller must not use the handle after the SubQuery is dropped.
Sourcepub fn set_num_candidates(&mut self, n: i32) -> Result<()>
pub fn set_num_candidates(&mut self, n: i32) -> Result<()>
Sets the number of candidates to retrieve before reranking.
Sourcepub fn num_candidates(&self) -> i32
pub fn num_candidates(&self) -> i32
Returns the number of candidates.
Sourcepub fn set_field_name(&mut self, name: &str) -> Result<()>
pub fn set_field_name(&mut self, name: &str) -> Result<()>
Sets the target field name.
Sourcepub fn set_query_vector(&mut self, data: &[f32]) -> Result<()>
pub fn set_query_vector(&mut self, data: &[f32]) -> Result<()>
Sets the dense query vector (f32).
Sourcepub fn set_sparse_vector(
&mut self,
indices: &[u32],
values: &[f32],
) -> Result<()>
pub fn set_sparse_vector( &mut self, indices: &[u32], values: &[f32], ) -> Result<()>
Sets the sparse vector (indices + values, equal length).
Sourcepub fn set_sparse_indices(&mut self, indices: &[u32]) -> Result<()>
pub fn set_sparse_indices(&mut self, indices: &[u32]) -> Result<()>
Sets only the sparse-vector indices.
Sourcepub fn set_sparse_values(&mut self, values: &[f32]) -> Result<()>
pub fn set_sparse_values(&mut self, values: &[f32]) -> Result<()>
Sets only the sparse-vector values.
Sourcepub fn set_hnsw_params(&mut self, params: HnswQueryParams) -> Result<()>
pub fn set_hnsw_params(&mut self, params: HnswQueryParams) -> Result<()>
Sets HNSW query parameters (takes ownership on success).
Sourcepub fn set_ivf_params(&mut self, params: IvfQueryParams) -> Result<()>
pub fn set_ivf_params(&mut self, params: IvfQueryParams) -> Result<()>
Sets IVF query parameters (takes ownership on success).
Sourcepub fn set_flat_params(&mut self, params: FlatQueryParams) -> Result<()>
pub fn set_flat_params(&mut self, params: FlatQueryParams) -> Result<()>
Sets Flat query parameters (takes ownership on success).
Sourcepub fn set_fts_params(&mut self, params: FtsQueryParams) -> Result<()>
pub fn set_fts_params(&mut self, params: FtsQueryParams) -> Result<()>
Sets FTS query parameters (takes ownership on success).
Trait Implementations§
Auto Trait Implementations§
impl !Sync for SubQuery
impl Freeze for SubQuery
impl RefUnwindSafe for SubQuery
impl Unpin for SubQuery
impl UnsafeUnpin for SubQuery
impl UnwindSafe for SubQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more