#[non_exhaustive]pub enum VectorFilter {
All,
Eq {
key: String,
value: Value,
},
Lt {
key: String,
value: Value,
},
Lte {
key: String,
value: Value,
},
Gt {
key: String,
value: Value,
},
Gte {
key: String,
value: Value,
},
Range {
key: String,
min: Value,
max: Value,
},
In {
key: String,
values: Vec<Value>,
},
Exists {
key: String,
},
And(Vec<Self>),
Or(Vec<Self>),
Not(Box<Self>),
}Expand description
Predicate against Document::metadata used by
VectorStore::search_filtered. Backends translate this into
their native filter language (pgvector WHERE, qdrant Filter,
lancedb where); backends that cannot honour a given variant
fall back to filterless search and emit a LossyEncode-style
warning at the operator layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
All
Always passes — useful as identity inside And/Or chains.
Eq
metadata.<key> == value.
Lt
metadata.<key> < value. Numeric semantics; non-numeric
operands produce an empty result set.
Lte
metadata.<key> <= value. Inclusive variant of Self::Lt.
Gt
metadata.<key> > value.
Gte
metadata.<key> >= value. Inclusive variant of Self::Gt.
Range
min <= metadata.<key> <= max. Closed interval — backends
that natively support range queries can push this down as a
single index probe instead of decomposing into And(Gte, Lte).
Fields
In
metadata.<key> is one of values. Empty values matches
no documents — equivalent to a no-op filter that can be used
to short-circuit zero-result queries without consulting the
index.
Exists
metadata.<key> is present (any value, including null).
Distinguishes “field unset” from “field set to null”.
And(Vec<Self>)
All children must match.
Or(Vec<Self>)
At least one child must match.
Not(Box<Self>)
Negate the inner filter.
Trait Implementations§
Source§impl Clone for VectorFilter
impl Clone for VectorFilter
Source§fn clone(&self) -> VectorFilter
fn clone(&self) -> VectorFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VectorFilter
impl Debug for VectorFilter
Source§impl PartialEq for VectorFilter
impl PartialEq for VectorFilter
Source§fn eq(&self, other: &VectorFilter) -> bool
fn eq(&self, other: &VectorFilter) -> bool
self and other values to be equal, and is used by ==.