pub enum FilterExpression {
Show 16 variants
Eq {
field: String,
value: Value,
},
Ne {
field: String,
value: Value,
},
Gt {
field: String,
value: Value,
},
Gte {
field: String,
value: Value,
},
Lt {
field: String,
value: Value,
},
Lte {
field: String,
value: Value,
},
Range {
field: String,
gte: Option<Value>,
lte: Option<Value>,
},
In {
field: String,
values: Vec<Value>,
},
Match {
field: String,
text: String,
},
GeoRadius {
field: String,
lat: f64,
lon: f64,
radius_m: f64,
},
GeoBoundingBox {
field: String,
top_left: (f64, f64),
bottom_right: (f64, f64),
},
And(Vec<FilterExpression>),
Or(Vec<FilterExpression>),
Not(Box<FilterExpression>),
Exists {
field: String,
},
IsNull {
field: String,
},
}Expand description
Filter expression for querying vectors by payload
Variants§
Eq
Ne
Gt
Gte
Lt
Lte
Range
In
Match
GeoRadius
GeoBoundingBox
And(Vec<FilterExpression>)
Or(Vec<FilterExpression>)
Not(Box<FilterExpression>)
Exists
IsNull
Implementations§
Source§impl FilterExpression
impl FilterExpression
Sourcepub fn gte(field: impl Into<String>, value: Value) -> Self
pub fn gte(field: impl Into<String>, value: Value) -> Self
Create a greater-than-or-equal filter
Sourcepub fn range(
field: impl Into<String>,
gte: Option<Value>,
lte: Option<Value>,
) -> Self
pub fn range( field: impl Into<String>, gte: Option<Value>, lte: Option<Value>, ) -> Self
Create a range filter
Sourcepub fn match_text(field: impl Into<String>, text: impl Into<String>) -> Self
pub fn match_text(field: impl Into<String>, text: impl Into<String>) -> Self
Create a text match filter
Sourcepub fn geo_radius(
field: impl Into<String>,
lat: f64,
lon: f64,
radius_m: f64,
) -> Self
pub fn geo_radius( field: impl Into<String>, lat: f64, lon: f64, radius_m: f64, ) -> Self
Create a geo radius filter
Sourcepub fn geo_bounding_box(
field: impl Into<String>,
top_left: (f64, f64),
bottom_right: (f64, f64),
) -> Self
pub fn geo_bounding_box( field: impl Into<String>, top_left: (f64, f64), bottom_right: (f64, f64), ) -> Self
Create a geo bounding box filter
Sourcepub fn and(filters: Vec<FilterExpression>) -> Self
pub fn and(filters: Vec<FilterExpression>) -> Self
Create an AND filter
Sourcepub fn or(filters: Vec<FilterExpression>) -> Self
pub fn or(filters: Vec<FilterExpression>) -> Self
Create an OR filter
Sourcepub fn not(filter: FilterExpression) -> Self
pub fn not(filter: FilterExpression) -> Self
Create a NOT filter
Sourcepub fn get_fields(&self) -> Vec<String>
pub fn get_fields(&self) -> Vec<String>
Get all field names referenced in this expression
Trait Implementations§
Source§impl Clone for FilterExpression
impl Clone for FilterExpression
Source§fn clone(&self) -> FilterExpression
fn clone(&self) -> FilterExpression
Returns a duplicate of the value. Read more
1.0.0 · 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 FilterExpression
impl Debug for FilterExpression
Source§impl<'de> Deserialize<'de> for FilterExpression
impl<'de> Deserialize<'de> for FilterExpression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FilterExpression
impl RefUnwindSafe for FilterExpression
impl Send for FilterExpression
impl Sync for FilterExpression
impl Unpin for FilterExpression
impl UnwindSafe for FilterExpression
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