pub trait BqSearchBackend: Send + Sync {
// Required methods
fn is_ready(&self) -> impl Future<Output = bool> + Send;
fn ensure_collection(
&self,
name: &str,
vector_size: u64,
) -> impl Future<Output = Result<(), VectorDbError>> + Send;
fn search_bq(
&self,
collection: &str,
query: Vec<f32>,
limit: u64,
tenant_filter: Option<u64>,
) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send;
fn upsert_points(
&self,
collection: &str,
points: Vec<VectorPoint>,
consistency: WriteConsistency,
) -> impl Future<Output = Result<(), VectorDbError>> + Send;
}Expand description
Backend required by the L2 cache for vector search + upsert.
Required Methods§
Sourcefn is_ready(&self) -> impl Future<Output = bool> + Send
fn is_ready(&self) -> impl Future<Output = bool> + Send
Returns true if the backend is ready for requests.
Sourcefn ensure_collection(
&self,
name: &str,
vector_size: u64,
) -> impl Future<Output = Result<(), VectorDbError>> + Send
fn ensure_collection( &self, name: &str, vector_size: u64, ) -> impl Future<Output = Result<(), VectorDbError>> + Send
Creates the collection if it doesn’t exist.
Sourcefn search_bq(
&self,
collection: &str,
query: Vec<f32>,
limit: u64,
tenant_filter: Option<u64>,
) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send
fn search_bq( &self, collection: &str, query: Vec<f32>, limit: u64, tenant_filter: Option<u64>, ) -> impl Future<Output = Result<Vec<SearchResult>, VectorDbError>> + Send
Performs a search against the binary-quantized index.
Sourcefn upsert_points(
&self,
collection: &str,
points: Vec<VectorPoint>,
consistency: WriteConsistency,
) -> impl Future<Output = Result<(), VectorDbError>> + Send
fn upsert_points( &self, collection: &str, points: Vec<VectorPoint>, consistency: WriteConsistency, ) -> impl Future<Output = Result<(), VectorDbError>> + Send
Upserts points into the collection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl BqSearchBackend for BqBackend
impl BqSearchBackend for BqClient
impl BqSearchBackend for MockBqClient
Available on crate features
mock only.