Skip to content

Commit 3951c57

Browse files
committed
Remove has vector condition builder, follow pattern of other conditions
1 parent a8bf329 commit 3951c57

File tree

3 files changed

+22
-43
lines changed

3 files changed

+22
-43
lines changed

src/builders/has_vector_condition_builder.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/builders/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ pub use create_collection_builder::CreateCollectionBuilder;
217217
pub mod count_points_builder;
218218
pub use count_points_builder::*;
219219

220-
pub mod has_vector_condition_builder;
221-
pub use has_vector_condition_builder::HasVectorConditionBuilder;
222-
223220
pub mod dense_vector_builder;
224221
pub use dense_vector_builder::DenseVectorBuilder;
225222

src/filters.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::qdrant::points_selector::PointsSelectorOneOf;
33
use crate::qdrant::r#match::MatchValue;
44
use crate::qdrant::{
55
self, Condition, DatetimeRange, FieldCondition, Filter, GeoBoundingBox, GeoPolygon, GeoRadius,
6-
HasIdCondition, IsEmptyCondition, IsNullCondition, MinShould, NestedCondition, PointId,
7-
PointsSelector, Range, ValuesCount,
6+
HasIdCondition, HasVectorCondition, IsEmptyCondition, IsNullCondition, MinShould,
7+
NestedCondition, PointId, PointsSelector, Range, ValuesCount,
88
};
99

1010
impl From<Filter> for PointsSelector {
@@ -47,6 +47,14 @@ impl From<HasIdCondition> for Condition {
4747
}
4848
}
4949

50+
impl From<HasVectorCondition> for Condition {
51+
fn from(has_vector_condition: HasVectorCondition) -> Self {
52+
Condition {
53+
condition_one_of: Some(ConditionOneOf::HasVector(has_vector_condition)),
54+
}
55+
}
56+
}
57+
5058
impl From<Filter> for Condition {
5159
fn from(filter: Filter) -> Self {
5260
Condition {
@@ -180,6 +188,18 @@ impl qdrant::Condition {
180188
})
181189
}
182190

191+
/// Create a [`Condition`] to check if the point has a specific named vector.
192+
///
193+
/// # Examples:
194+
/// ```
195+
/// qdrant_client::qdrant::Condition::has_vector("my_vector");
196+
/// ```
197+
pub fn has_vector(vector_name: impl Into<String>) -> Self {
198+
Self::from(qdrant::HasVectorCondition {
199+
has_vector: vector_name.into(),
200+
})
201+
}
202+
183203
/// Create a [`Condition`] that matches a field against a certain value.
184204
///
185205
/// # Examples:

0 commit comments

Comments
 (0)