Skip to content

Commit 96498bd

Browse files
authored
use condition constructors from latest client (#18)
1 parent 66416ef commit 96498bd

3 files changed

Lines changed: 17 additions & 30 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ clap = { version = "4.5.37", features = ["derive"] }
1414
futures = { version = "0.3.31", default-features = false, features = ["async-await", "std"] }
1515
tokio = { version = "1.44.2", features = ["full"] }
1616
tokio-stream = { version = "0.1.17", default-features = false, features = ["fs"] }
17-
qdrant-client = "1.13.0"
17+
qdrant-client = "1.14.0"
1818
ctrlc = "3.4.6"
1919
log = "0.4.27"
2020
env_logger = "0.11.8"

src/generators.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use qdrant_client::Payload;
44
use qdrant_client::qdrant::r#match::MatchValue;
55
use qdrant_client::qdrant::quantization_config::Quantization;
66
use qdrant_client::qdrant::{
7-
BinaryQuantization, Distance, FieldCondition, Filter, HnswConfigDiff, Match, MultiVectorConfig,
7+
BinaryQuantization, Condition, Distance, Filter, HnswConfigDiff, MultiVectorConfig,
88
ProductQuantization, QuantizationConfig, ScalarQuantization, SparseIndexConfig,
99
SparseVectorParams, VectorParams,
1010
};
@@ -478,24 +478,11 @@ pub fn random_filter(keywords: Option<usize>) -> Option<Filter> {
478478
let mut have_any = false;
479479
if let Some(keyword_variants) = keywords {
480480
have_any = true;
481-
filter.must.push(
482-
FieldCondition {
483-
key: KEYWORD_PAYLOAD_KEY.to_string(),
484-
r#match: Some(Match {
485-
match_value: Some(MatchValue::Keyword(random_keyword(
486-
&mut rng,
487-
keyword_variants,
488-
))),
489-
}),
490-
range: None,
491-
geo_bounding_box: None,
492-
geo_radius: None,
493-
values_count: None,
494-
geo_polygon: None,
495-
datetime_range: None,
496-
}
497-
.into(),
498-
)
481+
482+
filter.must.push(Condition::matches(
483+
KEYWORD_PAYLOAD_KEY,
484+
MatchValue::Keyword(random_keyword(&mut rng, keyword_variants)),
485+
));
499486
}
500487
if have_any { Some(filter) } else { None }
501488
}

0 commit comments

Comments
 (0)