Struct qdrant_client::qdrant::Condition
source · pub struct Condition {
pub condition_one_of: Option<ConditionOneOf>,
}Fields§
§condition_one_of: Option<ConditionOneOf>Implementations§
source§impl Condition
impl Condition
sourcepub fn is_empty(key: impl Into<String>) -> Self
pub fn is_empty(key: impl Into<String>) -> Self
create a Condition to check if a field is empty
Examples:
qdrant_client::qdrant::Condition::is_empty("field");sourcepub fn is_null(key: impl Into<String>) -> Self
pub fn is_null(key: impl Into<String>) -> Self
create a Condition to check if the point has a null key
Examples:
qdrant_client::qdrant::Condition::is_empty("remark");sourcepub fn has_id(ids: impl IntoIterator<Item = impl Into<PointId>>) -> Self
pub fn has_id(ids: impl IntoIterator<Item = impl Into<PointId>>) -> Self
create a Condition to check if the point has one of the given ids
Examples:
qdrant_client::qdrant::Condition::has_id([0, 8, 15]);sourcepub fn matches(field: impl Into<String>, match: impl Into<MatchValue>) -> Self
pub fn matches(field: impl Into<String>, match: impl Into<MatchValue>) -> Self
create a Condition that matches a field against a certain value
Examples:
qdrant_client::qdrant::Condition::matches("number", 42);
qdrant_client::qdrant::Condition::matches("tag", vec!["i".to_string(), "em".into()]);sourcepub fn range(field: impl Into<String>, range: Range) -> Self
pub fn range(field: impl Into<String>, range: Range) -> Self
create a Condition that checks numeric fields against a range
Examples:
use qdrant_client::qdrant::Range;
qdrant_client::qdrant::Condition::range("number", Range {
gte: Some(42.),
..Default::default()
});sourcepub fn geo_radius(field: impl Into<String>, geo_radius: GeoRadius) -> Self
pub fn geo_radius(field: impl Into<String>, geo_radius: GeoRadius) -> Self
create a Condition that checks geo fields against a radius
Examples:
use qdrant_client::qdrant::{GeoPoint, GeoRadius};
qdrant_client::qdrant::Condition::geo_radius("location", GeoRadius {
center: Some(GeoPoint { lon: 42., lat: 42. }),
radius: 42.,
});sourcepub fn geo_bounding_box(
field: impl Into<String>,
geo_bounding_box: GeoBoundingBox
) -> Self
pub fn geo_bounding_box( field: impl Into<String>, geo_bounding_box: GeoBoundingBox ) -> Self
create a Condition that checks geo fields against a bounding box
Examples:
use qdrant_client::qdrant::{GeoPoint, GeoBoundingBox};
qdrant_client::qdrant::Condition::geo_bounding_box("location", GeoBoundingBox {
top_left: Some(GeoPoint { lon: 42., lat: 42. }),
bottom_right: Some(GeoPoint { lon: 42., lat: 42. }),
});sourcepub fn geo_polygon(field: impl Into<String>, geo_polygon: GeoPolygon) -> Self
pub fn geo_polygon(field: impl Into<String>, geo_polygon: GeoPolygon) -> Self
create a Condition that checks geo fields against a geo polygons
Examples:
use qdrant_client::qdrant::{GeoLineString, GeoPoint, GeoPolygon};
let polygon = GeoPolygon {
exterior: Some(GeoLineString { points: vec![GeoPoint { lon: 42., lat: 42. }]}),
interiors: vec![],
};
qdrant_client::qdrant::Condition::geo_polygon("location", polygon);sourcepub fn values_count(field: impl Into<String>, values_count: ValuesCount) -> Self
pub fn values_count(field: impl Into<String>, values_count: ValuesCount) -> Self
create a Condition that checks count of values in a field
Examples:
use qdrant_client::qdrant::ValuesCount;
qdrant_client::qdrant::Condition::values_count("tags", ValuesCount {
gte: Some(42),
..Default::default()
});sourcepub fn nested(field: impl Into<String>, filter: Filter) -> Self
pub fn nested(field: impl Into<String>, filter: Filter) -> Self
create a Condition that applies a per-element filter to a nested array
The field parameter should be a key-path to a nested array of objects.
You may specify it as both array_field or array_field[].
For motivation and further examples, see API documentation.
Panics:
If debug assertions are enabled, this will panic if the filter, or any its subfilters,
contain a HasIdCondition (equivalently, a condition created with Self::has_id),
as these are unsupported for nested object filters.
Examples:
use qdrant_client::qdrant::Filter;
qdrant_client::qdrant::Condition::nested("array_field[]", Filter::any([
qdrant_client::qdrant::Condition::is_null("element_field")
]));Trait Implementations§
source§impl From<FieldCondition> for Condition
impl From<FieldCondition> for Condition
source§fn from(field_condition: FieldCondition) -> Self
fn from(field_condition: FieldCondition) -> Self
source§impl From<HasIdCondition> for Condition
impl From<HasIdCondition> for Condition
source§fn from(has_id_condition: HasIdCondition) -> Self
fn from(has_id_condition: HasIdCondition) -> Self
source§impl From<IsEmptyCondition> for Condition
impl From<IsEmptyCondition> for Condition
source§fn from(is_empty_condition: IsEmptyCondition) -> Self
fn from(is_empty_condition: IsEmptyCondition) -> Self
source§impl From<IsNullCondition> for Condition
impl From<IsNullCondition> for Condition
source§fn from(is_null_condition: IsNullCondition) -> Self
fn from(is_null_condition: IsNullCondition) -> Self
source§impl From<NestedCondition> for Condition
impl From<NestedCondition> for Condition
source§fn from(nested_condition: NestedCondition) -> Self
fn from(nested_condition: NestedCondition) -> Self
source§impl Message for Condition
impl Message for Condition
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self.source§impl PartialEq for Condition
impl PartialEq for Condition
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request