pub trait BatchOpsExt: PgVectorStore {
// Required methods
fn batch_search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
queries: &'life2 [Vec<f32>],
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<SearchResult>>, VectorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn batch_get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<VectorRecord>>, VectorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn search_with_filter<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
collection: &'life1 str,
query: &'life2 [f32],
top_k: usize,
filter_key: &'life3 str,
filter_value: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, VectorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}Expand description
批量向量操作扩展 trait
提供一次调用处理多个查询/记录的能力,减少网络往返开销。
Required Methods§
Sourcefn batch_search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
queries: &'life2 [Vec<f32>],
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<SearchResult>>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn batch_search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
queries: &'life2 [Vec<f32>],
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<SearchResult>>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
批量搜索:一次提交多个查询向量
返回与查询数量相同的结果列表,每个结果为对应查询的 top_k 结果
Sourcefn batch_get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<VectorRecord>>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn batch_get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<VectorRecord>>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
批量获取:一次获取多个 id 的记录
Sourcefn search_with_filter<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
collection: &'life1 str,
query: &'life2 [f32],
top_k: usize,
filter_key: &'life3 str,
filter_value: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn search_with_filter<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
collection: &'life1 str,
query: &'life2 [f32],
top_k: usize,
filter_key: &'life3 str,
filter_value: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
按元数据过滤搜索
仅返回 metadata 中包含指定 key=value 的记录
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".