pub struct VectorQuery {
pub vector: Vec<f32>,
pub top_k: usize,
pub score_threshold: Option<f32>,
pub filter: Option<Value>,
}Expand description
查询条件。
Fields§
§vector: Vec<f32>查询向量。
top_k: usize返回结果数量(默认 10)。
score_threshold: Option<f32>最小相似度阈值(可选,过滤低相似度结果)。
filter: Option<Value>元数据过滤条件(可选,JSON 格式)。
Implementations§
Source§impl VectorQuery
impl VectorQuery
Sourcepub fn with_top_k(self, top_k: usize) -> Self
pub fn with_top_k(self, top_k: usize) -> Self
设置返回数量。
Sourcepub fn with_score_threshold(self, threshold: f32) -> Self
pub fn with_score_threshold(self, threshold: f32) -> Self
设置相似度阈值。
Sourcepub fn with_filter(self, filter: Value) -> Self
pub fn with_filter(self, filter: Value) -> Self
设置过滤条件。
Trait Implementations§
Source§impl Clone for VectorQuery
impl Clone for VectorQuery
Source§fn clone(&self) -> VectorQuery
fn clone(&self) -> VectorQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VectorQuery
impl Debug for VectorQuery
Source§impl Default for VectorQuery
impl Default for VectorQuery
Source§fn default() -> VectorQuery
fn default() -> VectorQuery
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VectorQuery
impl RefUnwindSafe for VectorQuery
impl Send for VectorQuery
impl Sync for VectorQuery
impl Unpin for VectorQuery
impl UnsafeUnpin for VectorQuery
impl UnwindSafe for VectorQuery
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