Skip to main content

SubQuery

Struct SubQuery 

Source
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

Source

pub fn new() -> Result<Self>

Creates a new sub-query.

Source

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.

Source

pub fn set_num_candidates(&mut self, n: i32) -> Result<()>

Sets the number of candidates to retrieve before reranking.

Source

pub fn num_candidates(&self) -> i32

Returns the number of candidates.

Source

pub fn set_field_name(&mut self, name: &str) -> Result<()>

Sets the target field name.

Source

pub fn set_query_vector(&mut self, data: &[f32]) -> Result<()>

Sets the dense query vector (f32).

Source

pub fn set_sparse_vector( &mut self, indices: &[u32], values: &[f32], ) -> Result<()>

Sets the sparse vector (indices + values, equal length).

Source

pub fn set_sparse_indices(&mut self, indices: &[u32]) -> Result<()>

Sets only the sparse-vector indices.

Source

pub fn set_sparse_values(&mut self, values: &[f32]) -> Result<()>

Sets only the sparse-vector values.

Source

pub fn set_hnsw_params(&mut self, params: HnswQueryParams) -> Result<()>

Sets HNSW query parameters (takes ownership on success).

Source

pub fn set_ivf_params(&mut self, params: IvfQueryParams) -> Result<()>

Sets IVF query parameters (takes ownership on success).

Source

pub fn set_flat_params(&mut self, params: FlatQueryParams) -> Result<()>

Sets Flat query parameters (takes ownership on success).

Source

pub fn set_fts_params(&mut self, params: FtsQueryParams) -> Result<()>

Sets FTS query parameters (takes ownership on success).

Source

pub fn set_fts(&mut self, fts: &Fts) -> Result<()>

Sets FTS payload (payload is copied, caller retains ownership).

Trait Implementations§

Source§

impl Drop for SubQuery

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 SubQuery

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.