From 2d7e956296e74518ebd353dd860b26f143e4be2c Mon Sep 17 00:00:00 2001 From: generall Date: Mon, 16 Mar 2026 23:45:29 +0100 Subject: [PATCH] remove test autogeneration --- build.rs | 83 --------- tests/snippet_tests/test_batch_update.rs | 2 - tests/snippet_tests/test_clear_payload.rs | 2 - tests/snippet_tests/test_collection_exists.rs | 2 - tests/snippet_tests/test_count_points.rs | 2 - tests/snippet_tests/test_create_collection.rs | 2 - .../test_create_collection_with_bq.rs | 2 - .../test_create_collection_with_metadata.rs | 2 - .../snippet_tests/test_create_field_index.rs | 2 - .../test_create_full_snapshot.rs | 2 - tests/snippet_tests/test_create_shard_key.rs | 2 - tests/snippet_tests/test_create_snapshot.rs | 2 - tests/snippet_tests/test_create_text_index.rs | 2 - tests/snippet_tests/test_delete_collection.rs | 2 - .../snippet_tests/test_delete_field_index.rs | 2 - .../test_delete_full_snapshot.rs | 2 - tests/snippet_tests/test_delete_payload.rs | 2 - tests/snippet_tests/test_delete_points.rs | 2 - tests/snippet_tests/test_delete_shard_key.rs | 2 - tests/snippet_tests/test_delete_snapshot.rs | 2 - tests/snippet_tests/test_delete_vectors.rs | 2 - .../test_discover_batch_points.rs | 2 - tests/snippet_tests/test_discover_points.rs | 2 - tests/snippet_tests/test_facets.rs | 2 - tests/snippet_tests/test_get_collection.rs | 2 - .../test_get_collection_aliases.rs | 2 - tests/snippet_tests/test_get_collections.rs | 2 - .../test_get_collections_aliases.rs | 2 - tests/snippet_tests/test_get_points.rs | 2 - .../snippet_tests/test_list_full_snapshots.rs | 2 - tests/snippet_tests/test_list_shard_keys.rs | 2 - tests/snippet_tests/test_list_snapshots.rs | 2 - tests/snippet_tests/test_overwrite_payload.rs | 2 - tests/snippet_tests/test_query_document.rs | 2 - tests/snippet_tests/test_query_image.rs | 2 - tests/snippet_tests/test_query_points.rs | 2 - .../snippet_tests/test_query_points_groups.rs | 2 - .../test_query_points_relevance_feedback.rs | 2 - .../test_recommend_batch_points.rs | 2 - .../test_recommend_point_groups.rs | 2 - tests/snippet_tests/test_recommend_points.rs | 2 - tests/snippet_tests/test_replicate_points.rs | 2 - tests/snippet_tests/test_scroll_points.rs | 2 - .../test_scroll_points_with_vectors.rs | 2 - .../snippet_tests/test_search_batch_points.rs | 2 - .../test_search_matrix_offsets.rs | 2 - .../snippet_tests/test_search_matrix_pairs.rs | 2 - .../snippet_tests/test_search_point_groups.rs | 2 - tests/snippet_tests/test_search_points.rs | 2 - tests/snippet_tests/test_set_payload.rs | 2 - tests/snippet_tests/test_update_aliases.rs | 2 - tests/snippet_tests/test_update_collection.rs | 2 - .../test_update_collection_metadata.rs | 2 - tests/snippet_tests/test_update_vectors.rs | 2 - tests/snippet_tests/test_upsert_document.rs | 2 - tests/snippet_tests/test_upsert_image.rs | 2 - tests/snippet_tests/test_upsert_points.rs | 2 - .../test_upsert_points_fallback_shard_key.rs | 2 - .../test_upsert_points_insert_only.rs | 2 - .../test_upsert_points_with_condition.rs | 2 - tests/snippet_tests/test_with_header.rs | 2 - tests/snippets/batch_update.rs | 56 ------ tests/snippets/clear_payload.rs | 12 -- tests/snippets/collection_exists.rs | 5 - tests/snippets/count_points.rs | 15 -- tests/snippets/create_collection.rs | 11 -- tests/snippets/create_collection_with_bq.rs | 18 -- .../create_collection_with_metadata.rs | 20 -- tests/snippets/create_field_index.rs | 14 -- tests/snippets/create_full_snapshot.rs | 5 - tests/snippets/create_shard_key.rs | 16 -- tests/snippets/create_snapshot.rs | 5 - tests/snippets/create_text_index.rs | 24 --- tests/snippets/delete_collection.rs | 5 - tests/snippets/delete_field_index.rs | 11 -- tests/snippets/delete_full_snapshot.rs | 5 - tests/snippets/delete_payload.rs | 17 -- tests/snippets/delete_points.rs | 25 --- tests/snippets/delete_shard_key.rs | 12 -- tests/snippets/delete_snapshot.rs | 11 -- tests/snippets/delete_vectors.rs | 17 -- tests/snippets/discover_batch_points.rs | 45 ----- tests/snippets/discover_points.rs | 29 --- tests/snippets/facets.rs | 15 -- tests/snippets/get_collection.rs | 5 - tests/snippets/get_collection_aliases.rs | 5 - tests/snippets/get_collections.rs | 5 - tests/snippets/get_collections_aliases.rs | 5 - tests/snippets/get_points.rs | 11 -- tests/snippets/list_full_snapshots.rs | 5 - tests/snippets/list_shard_keys.rs | 5 - tests/snippets/list_snapshots.rs | 5 - tests/snippets/overwrite_payload.rs | 24 --- tests/snippets/query_document.rs | 16 -- tests/snippets/query_image.rs | 16 -- tests/snippets/query_points.rs | 173 ------------------ tests/snippets/query_points_groups.rs | 11 -- .../query_points_relevance_feedback.rs | 19 -- tests/snippets/recommend_batch_points.rs | 29 --- tests/snippets/recommend_point_groups.rs | 14 -- tests/snippets/recommend_points.rs | 20 -- tests/snippets/replicate_points.rs | 25 --- tests/snippets/scroll_points.rs | 29 --- tests/snippets/scroll_points_with_vectors.rs | 22 --- tests/snippets/search_batch_points.rs | 21 --- tests/snippets/search_matrix_offsets.rs | 16 -- tests/snippets/search_matrix_pairs.rs | 16 -- tests/snippets/search_point_groups.rs | 14 -- tests/snippets/search_points.rs | 42 ----- tests/snippets/set_payload.rs | 22 --- tests/snippets/update_aliases.rs | 17 -- tests/snippets/update_collection.rs | 12 -- tests/snippets/update_collection_metadata.rs | 18 -- tests/snippets/update_vectors.rs | 33 ---- tests/snippets/upsert_document.rs | 26 --- tests/snippets/upsert_image.rs | 26 --- tests/snippets/upsert_points.rs | 40 ---- .../upsert_points_fallback_shard_key.rs | 29 --- tests/snippets/upsert_points_insert_only.rs | 24 --- .../snippets/upsert_points_with_condition.rs | 24 --- tests/snippets/with_header.rs | 22 --- 121 files changed, 1442 deletions(-) delete mode 100644 build.rs delete mode 100644 tests/snippets/batch_update.rs delete mode 100644 tests/snippets/clear_payload.rs delete mode 100644 tests/snippets/collection_exists.rs delete mode 100644 tests/snippets/count_points.rs delete mode 100644 tests/snippets/create_collection.rs delete mode 100644 tests/snippets/create_collection_with_bq.rs delete mode 100644 tests/snippets/create_collection_with_metadata.rs delete mode 100644 tests/snippets/create_field_index.rs delete mode 100644 tests/snippets/create_full_snapshot.rs delete mode 100644 tests/snippets/create_shard_key.rs delete mode 100644 tests/snippets/create_snapshot.rs delete mode 100644 tests/snippets/create_text_index.rs delete mode 100644 tests/snippets/delete_collection.rs delete mode 100644 tests/snippets/delete_field_index.rs delete mode 100644 tests/snippets/delete_full_snapshot.rs delete mode 100644 tests/snippets/delete_payload.rs delete mode 100644 tests/snippets/delete_points.rs delete mode 100644 tests/snippets/delete_shard_key.rs delete mode 100644 tests/snippets/delete_snapshot.rs delete mode 100644 tests/snippets/delete_vectors.rs delete mode 100644 tests/snippets/discover_batch_points.rs delete mode 100644 tests/snippets/discover_points.rs delete mode 100644 tests/snippets/facets.rs delete mode 100644 tests/snippets/get_collection.rs delete mode 100644 tests/snippets/get_collection_aliases.rs delete mode 100644 tests/snippets/get_collections.rs delete mode 100644 tests/snippets/get_collections_aliases.rs delete mode 100644 tests/snippets/get_points.rs delete mode 100644 tests/snippets/list_full_snapshots.rs delete mode 100644 tests/snippets/list_shard_keys.rs delete mode 100644 tests/snippets/list_snapshots.rs delete mode 100644 tests/snippets/overwrite_payload.rs delete mode 100644 tests/snippets/query_document.rs delete mode 100644 tests/snippets/query_image.rs delete mode 100644 tests/snippets/query_points.rs delete mode 100644 tests/snippets/query_points_groups.rs delete mode 100644 tests/snippets/query_points_relevance_feedback.rs delete mode 100644 tests/snippets/recommend_batch_points.rs delete mode 100644 tests/snippets/recommend_point_groups.rs delete mode 100644 tests/snippets/recommend_points.rs delete mode 100644 tests/snippets/replicate_points.rs delete mode 100644 tests/snippets/scroll_points.rs delete mode 100644 tests/snippets/scroll_points_with_vectors.rs delete mode 100644 tests/snippets/search_batch_points.rs delete mode 100644 tests/snippets/search_matrix_offsets.rs delete mode 100644 tests/snippets/search_matrix_pairs.rs delete mode 100644 tests/snippets/search_point_groups.rs delete mode 100644 tests/snippets/search_points.rs delete mode 100644 tests/snippets/set_payload.rs delete mode 100644 tests/snippets/update_aliases.rs delete mode 100644 tests/snippets/update_collection.rs delete mode 100644 tests/snippets/update_collection_metadata.rs delete mode 100644 tests/snippets/update_vectors.rs delete mode 100644 tests/snippets/upsert_document.rs delete mode 100644 tests/snippets/upsert_image.rs delete mode 100644 tests/snippets/upsert_points.rs delete mode 100644 tests/snippets/upsert_points_fallback_shard_key.rs delete mode 100644 tests/snippets/upsert_points_insert_only.rs delete mode 100644 tests/snippets/upsert_points_with_condition.rs delete mode 100644 tests/snippets/with_header.rs diff --git a/build.rs b/build.rs deleted file mode 100644 index 1c917e58..00000000 --- a/build.rs +++ /dev/null @@ -1,83 +0,0 @@ -use std::fs; -use std::path::{Path, PathBuf}; - -fn generate_snippet_test(snippet: &str, name: &str, dir: &Path) { - // Pad each line of the snippet with 8 spaces - - let snippet = snippet - .lines() - .map(|line| format!(" {line}")) - .collect::>() - .join("\n"); - - let test_snippet = format!( - r#" -#[tokio::test] -async fn test_{name}() {{ - async fn {name}() -> Result<(), Box> {{ - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/{name}.rs` file -{snippet} - Ok(()) - }} - let _ = {name}().await; -}} -"# - ); - - // Write the test snippet to the file - let mut test_snippet_path = PathBuf::from(dir); - test_snippet_path.push(format!("test_{name}.rs")); - fs::write(test_snippet_path, test_snippet).unwrap(); -} - -fn main() { - println!("cargo:rerun-if-changed=tests/snippets"); - - #[cfg(not(feature = "generate-snippets"))] - return; - - // Open all files in the `./tests/snippets` directory and save them to the `./tests/snippets_converted` directory - // Wrap text in the `tests/test_snippets.rs` file into { } - let snippets_dir = Path::new("./tests/snippets"); - let tests_output_dir = Path::new("./tests/snippet_tests"); - - // Create the converted directory if it doesn't exist - if !tests_output_dir.exists() { - fs::create_dir_all(tests_output_dir).unwrap(); - } - - let mut snippet_names: Vec<_> = fs::read_dir(snippets_dir) - .unwrap() - .filter_map(|entry| { - let entry = entry.unwrap(); - let path = entry.path(); - if path.is_file() { - let snippet_name = path.file_stem().unwrap().to_str().unwrap().to_string(); - Some((path, snippet_name)) - } else { - None - } - }) - .collect(); - - snippet_names.sort_unstable_by_key(|(_, name)| name.clone()); - - for (path, name) in &snippet_names { - let content = fs::read_to_string(path).unwrap(); - generate_snippet_test(&content, name, tests_output_dir); - } - - // Generate `tests/snippet_tests/mod.rs` file - // For each file in `./tests/snippet_tests` directory, generate a line `mode {file_name};` - - let mod_file = snippet_names - .iter() - .map(|(_, name)| format!("mod test_{name};")) - .collect::>() - .join("\n"); - - let mut mod_file_path = PathBuf::from(tests_output_dir); - mod_file_path.push("mod.rs"); - fs::write(mod_file_path, mod_file).unwrap(); -} diff --git a/tests/snippet_tests/test_batch_update.rs b/tests/snippet_tests/test_batch_update.rs index c31c636a..7e7cf549 100644 --- a/tests/snippet_tests/test_batch_update.rs +++ b/tests/snippet_tests/test_batch_update.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_batch_update() { async fn batch_update() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/batch_update.rs` file use qdrant_client::qdrant::{ points_selector::PointsSelectorOneOf, points_update_operation::{ diff --git a/tests/snippet_tests/test_clear_payload.rs b/tests/snippet_tests/test_clear_payload.rs index f0a0e812..f5617c04 100644 --- a/tests/snippet_tests/test_clear_payload.rs +++ b/tests/snippet_tests/test_clear_payload.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_clear_payload() { async fn clear_payload() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/clear_payload.rs` file use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_collection_exists.rs b/tests/snippet_tests/test_collection_exists.rs index d5011f80..99a07b15 100644 --- a/tests/snippet_tests/test_collection_exists.rs +++ b/tests/snippet_tests/test_collection_exists.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_collection_exists() { async fn collection_exists() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/collection_exists.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_count_points.rs b/tests/snippet_tests/test_count_points.rs index b5a2e3b5..b9085f74 100644 --- a/tests/snippet_tests/test_count_points.rs +++ b/tests/snippet_tests/test_count_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_count_points() { async fn count_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/count_points.rs` file use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_create_collection.rs b/tests/snippet_tests/test_create_collection.rs index cd22542d..8ba687f0 100644 --- a/tests/snippet_tests/test_create_collection.rs +++ b/tests/snippet_tests/test_create_collection.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_collection() { async fn create_collection() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_collection.rs` file use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_create_collection_with_bq.rs b/tests/snippet_tests/test_create_collection_with_bq.rs index 1487cdc3..0ac8410b 100644 --- a/tests/snippet_tests/test_create_collection_with_bq.rs +++ b/tests/snippet_tests/test_create_collection_with_bq.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_collection_with_bq() { async fn create_collection_with_bq() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_collection_with_bq.rs` file use qdrant_client::qdrant::{ BinaryQuantizationBuilder, BinaryQuantizationEncoding, CreateCollectionBuilder, Distance, VectorParamsBuilder, BinaryQuantizationQueryEncoding, }; diff --git a/tests/snippet_tests/test_create_collection_with_metadata.rs b/tests/snippet_tests/test_create_collection_with_metadata.rs index 35daad58..3250bc03 100644 --- a/tests/snippet_tests/test_create_collection_with_metadata.rs +++ b/tests/snippet_tests/test_create_collection_with_metadata.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_collection_with_metadata() { async fn create_collection_with_metadata() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_collection_with_metadata.rs` file use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder}; use qdrant_client::Qdrant; use serde_json::{json, Value}; diff --git a/tests/snippet_tests/test_create_field_index.rs b/tests/snippet_tests/test_create_field_index.rs index 0e296758..b9491828 100644 --- a/tests/snippet_tests/test_create_field_index.rs +++ b/tests/snippet_tests/test_create_field_index.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_field_index() { async fn create_field_index() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_field_index.rs` file use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_create_full_snapshot.rs b/tests/snippet_tests/test_create_full_snapshot.rs index 70943d20..0addc887 100644 --- a/tests/snippet_tests/test_create_full_snapshot.rs +++ b/tests/snippet_tests/test_create_full_snapshot.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_full_snapshot() { async fn create_full_snapshot() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_full_snapshot.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_create_shard_key.rs b/tests/snippet_tests/test_create_shard_key.rs index 14f9a8e4..bba78926 100644 --- a/tests/snippet_tests/test_create_shard_key.rs +++ b/tests/snippet_tests/test_create_shard_key.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_shard_key() { async fn create_shard_key() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_shard_key.rs` file use qdrant_client::qdrant::shard_key::Key; use qdrant_client::qdrant::{CreateShardKeyBuilder, CreateShardKeyRequestBuilder}; use qdrant_client::qdrant::ReplicaState; diff --git a/tests/snippet_tests/test_create_snapshot.rs b/tests/snippet_tests/test_create_snapshot.rs index 464484ff..53384b29 100644 --- a/tests/snippet_tests/test_create_snapshot.rs +++ b/tests/snippet_tests/test_create_snapshot.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_snapshot() { async fn create_snapshot() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_snapshot.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_create_text_index.rs b/tests/snippet_tests/test_create_text_index.rs index 9f22f521..85a693c9 100644 --- a/tests/snippet_tests/test_create_text_index.rs +++ b/tests/snippet_tests/test_create_text_index.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_create_text_index() { async fn create_text_index() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/create_text_index.rs` file use qdrant_client::qdrant::{ CreateFieldIndexCollectionBuilder, TextIndexParamsBuilder, diff --git a/tests/snippet_tests/test_delete_collection.rs b/tests/snippet_tests/test_delete_collection.rs index cb159b23..a6c303c6 100644 --- a/tests/snippet_tests/test_delete_collection.rs +++ b/tests/snippet_tests/test_delete_collection.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_collection() { async fn delete_collection() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_collection.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_delete_field_index.rs b/tests/snippet_tests/test_delete_field_index.rs index 8e53a7d9..792892a4 100644 --- a/tests/snippet_tests/test_delete_field_index.rs +++ b/tests/snippet_tests/test_delete_field_index.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_field_index() { async fn delete_field_index() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_field_index.rs` file use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_delete_full_snapshot.rs b/tests/snippet_tests/test_delete_full_snapshot.rs index 8aaa9727..1d5d1f1e 100644 --- a/tests/snippet_tests/test_delete_full_snapshot.rs +++ b/tests/snippet_tests/test_delete_full_snapshot.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_full_snapshot() { async fn delete_full_snapshot() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_full_snapshot.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_delete_payload.rs b/tests/snippet_tests/test_delete_payload.rs index ae32c741..0a1ad2b5 100644 --- a/tests/snippet_tests/test_delete_payload.rs +++ b/tests/snippet_tests/test_delete_payload.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_payload() { async fn delete_payload() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_payload.rs` file use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_delete_points.rs b/tests/snippet_tests/test_delete_points.rs index 4b41850c..7ebcaf6a 100644 --- a/tests/snippet_tests/test_delete_points.rs +++ b/tests/snippet_tests/test_delete_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_points() { async fn delete_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_points.rs` file use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_delete_shard_key.rs b/tests/snippet_tests/test_delete_shard_key.rs index fa0cabfa..fa8ba81b 100644 --- a/tests/snippet_tests/test_delete_shard_key.rs +++ b/tests/snippet_tests/test_delete_shard_key.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_shard_key() { async fn delete_shard_key() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_shard_key.rs` file use qdrant_client::qdrant::shard_key::Key; use qdrant_client::qdrant::DeleteShardKeyRequestBuilder; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_delete_snapshot.rs b/tests/snippet_tests/test_delete_snapshot.rs index c16e9e99..710dd534 100644 --- a/tests/snippet_tests/test_delete_snapshot.rs +++ b/tests/snippet_tests/test_delete_snapshot.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_snapshot() { async fn delete_snapshot() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_snapshot.rs` file use qdrant_client::qdrant::DeleteSnapshotRequestBuilder; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_delete_vectors.rs b/tests/snippet_tests/test_delete_vectors.rs index 1564b83d..844aee7d 100644 --- a/tests/snippet_tests/test_delete_vectors.rs +++ b/tests/snippet_tests/test_delete_vectors.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_delete_vectors() { async fn delete_vectors() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/delete_vectors.rs` file use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList, VectorsSelector}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_discover_batch_points.rs b/tests/snippet_tests/test_discover_batch_points.rs index 975bb5f0..e2cdc9bb 100644 --- a/tests/snippet_tests/test_discover_batch_points.rs +++ b/tests/snippet_tests/test_discover_batch_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_discover_batch_points() { async fn discover_batch_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/discover_batch_points.rs` file use qdrant_client::qdrant::{ vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder, DiscoverPointsBuilder, diff --git a/tests/snippet_tests/test_discover_points.rs b/tests/snippet_tests/test_discover_points.rs index d2c84731..96f94a8c 100644 --- a/tests/snippet_tests/test_discover_points.rs +++ b/tests/snippet_tests/test_discover_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_discover_points() { async fn discover_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/discover_points.rs` file use qdrant_client::qdrant::{ target_vector::Target, vector_example::Example, ContextExamplePairBuilder, DiscoverPointsBuilder, VectorExample, diff --git a/tests/snippet_tests/test_facets.rs b/tests/snippet_tests/test_facets.rs index 951125f8..8e1f3f2e 100644 --- a/tests/snippet_tests/test_facets.rs +++ b/tests/snippet_tests/test_facets.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_facets() { async fn facets() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/facets.rs` file use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_get_collection.rs b/tests/snippet_tests/test_get_collection.rs index b5d9faf7..a30f3975 100644 --- a/tests/snippet_tests/test_get_collection.rs +++ b/tests/snippet_tests/test_get_collection.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_get_collection() { async fn get_collection() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/get_collection.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_get_collection_aliases.rs b/tests/snippet_tests/test_get_collection_aliases.rs index 01a44c7d..6b7a61fc 100644 --- a/tests/snippet_tests/test_get_collection_aliases.rs +++ b/tests/snippet_tests/test_get_collection_aliases.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_get_collection_aliases() { async fn get_collection_aliases() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/get_collection_aliases.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_get_collections.rs b/tests/snippet_tests/test_get_collections.rs index c0bec8b3..4f93c7af 100644 --- a/tests/snippet_tests/test_get_collections.rs +++ b/tests/snippet_tests/test_get_collections.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_get_collections() { async fn get_collections() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/get_collections.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_get_collections_aliases.rs b/tests/snippet_tests/test_get_collections_aliases.rs index 79b48779..fe318e2d 100644 --- a/tests/snippet_tests/test_get_collections_aliases.rs +++ b/tests/snippet_tests/test_get_collections_aliases.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_get_collections_aliases() { async fn get_collections_aliases() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/get_collections_aliases.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_get_points.rs b/tests/snippet_tests/test_get_points.rs index 83824c19..1eb7b321 100644 --- a/tests/snippet_tests/test_get_points.rs +++ b/tests/snippet_tests/test_get_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_get_points() { async fn get_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/get_points.rs` file use qdrant_client::qdrant::GetPointsBuilder; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_list_full_snapshots.rs b/tests/snippet_tests/test_list_full_snapshots.rs index b33a46c0..005fbfb5 100644 --- a/tests/snippet_tests/test_list_full_snapshots.rs +++ b/tests/snippet_tests/test_list_full_snapshots.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_list_full_snapshots() { async fn list_full_snapshots() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/list_full_snapshots.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_list_shard_keys.rs b/tests/snippet_tests/test_list_shard_keys.rs index cb36853c..63384202 100644 --- a/tests/snippet_tests/test_list_shard_keys.rs +++ b/tests/snippet_tests/test_list_shard_keys.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_list_shard_keys() { async fn list_shard_keys() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/list_shard_keys.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_list_snapshots.rs b/tests/snippet_tests/test_list_snapshots.rs index d6aaf68d..7e2b7357 100644 --- a/tests/snippet_tests/test_list_snapshots.rs +++ b/tests/snippet_tests/test_list_snapshots.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_list_snapshots() { async fn list_snapshots() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/list_snapshots.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334").build()?; diff --git a/tests/snippet_tests/test_overwrite_payload.rs b/tests/snippet_tests/test_overwrite_payload.rs index c1d69c92..618c2a10 100644 --- a/tests/snippet_tests/test_overwrite_payload.rs +++ b/tests/snippet_tests/test_overwrite_payload.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_overwrite_payload() { async fn overwrite_payload() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/overwrite_payload.rs` file use qdrant_client::qdrant::{ points_selector::PointsSelectorOneOf, PointsIdsList, SetPayloadPointsBuilder, }; diff --git a/tests/snippet_tests/test_query_document.rs b/tests/snippet_tests/test_query_document.rs index ecd3cea4..be675e95 100644 --- a/tests/snippet_tests/test_query_document.rs +++ b/tests/snippet_tests/test_query_document.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_query_document() { async fn query_document() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/query_document.rs` file use qdrant_client::qdrant::{Document, Query, QueryPointsBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_query_image.rs b/tests/snippet_tests/test_query_image.rs index f98a6e7d..7b64dc41 100644 --- a/tests/snippet_tests/test_query_image.rs +++ b/tests/snippet_tests/test_query_image.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_query_image() { async fn query_image() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/query_image.rs` file use qdrant_client::qdrant::{Image, Query, QueryPointsBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_query_points.rs b/tests/snippet_tests/test_query_points.rs index 3edaae80..a950d0c9 100644 --- a/tests/snippet_tests/test_query_points.rs +++ b/tests/snippet_tests/test_query_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_query_points() { async fn query_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/query_points.rs` file use qdrant_client::qdrant::{ AcornSearchParamsBuilder, Condition, DecayParamsExpressionBuilder, Expression, Filter, FormulaBuilder, Fusion, GeoPoint, diff --git a/tests/snippet_tests/test_query_points_groups.rs b/tests/snippet_tests/test_query_points_groups.rs index 90647393..ac8cc9e9 100644 --- a/tests/snippet_tests/test_query_points_groups.rs +++ b/tests/snippet_tests/test_query_points_groups.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_query_points_groups() { async fn query_points_groups() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/query_points_groups.rs` file use qdrant_client::Qdrant; use qdrant_client::qdrant::{Query, QueryPointGroupsBuilder}; diff --git a/tests/snippet_tests/test_query_points_relevance_feedback.rs b/tests/snippet_tests/test_query_points_relevance_feedback.rs index 64f5bcf8..2c687363 100644 --- a/tests/snippet_tests/test_query_points_relevance_feedback.rs +++ b/tests/snippet_tests/test_query_points_relevance_feedback.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_query_points_relevance_feedback() { async fn query_points_relevance_feedback() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/query_points_relevance_feedback.rs` file use qdrant_client::qdrant::{ FeedbackItemBuilder, FeedbackStrategyBuilder, PointId, Query, QueryPointsBuilder, RelevanceFeedbackInputBuilder, VectorInput, diff --git a/tests/snippet_tests/test_recommend_batch_points.rs b/tests/snippet_tests/test_recommend_batch_points.rs index ac7d3d50..dfde18a3 100644 --- a/tests/snippet_tests/test_recommend_batch_points.rs +++ b/tests/snippet_tests/test_recommend_batch_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_recommend_batch_points() { async fn recommend_batch_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/recommend_batch_points.rs` file use qdrant_client::qdrant::{ Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder, }; diff --git a/tests/snippet_tests/test_recommend_point_groups.rs b/tests/snippet_tests/test_recommend_point_groups.rs index e8183b04..bc99666d 100644 --- a/tests/snippet_tests/test_recommend_point_groups.rs +++ b/tests/snippet_tests/test_recommend_point_groups.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_recommend_point_groups() { async fn recommend_point_groups() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/recommend_point_groups.rs` file use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_recommend_points.rs b/tests/snippet_tests/test_recommend_points.rs index a13fd3cb..31ad08fa 100644 --- a/tests/snippet_tests/test_recommend_points.rs +++ b/tests/snippet_tests/test_recommend_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_recommend_points() { async fn recommend_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/recommend_points.rs` file use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_replicate_points.rs b/tests/snippet_tests/test_replicate_points.rs index c142e69f..feed41f7 100644 --- a/tests/snippet_tests/test_replicate_points.rs +++ b/tests/snippet_tests/test_replicate_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_replicate_points() { async fn replicate_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/replicate_points.rs` file use qdrant_client::qdrant::{ update_collection_cluster_setup_request::Operation, Condition, Filter, ReplicatePointsBuilder, ShardKey, UpdateCollectionClusterSetupRequest, diff --git a/tests/snippet_tests/test_scroll_points.rs b/tests/snippet_tests/test_scroll_points.rs index 06d7118f..55abfc93 100644 --- a/tests/snippet_tests/test_scroll_points.rs +++ b/tests/snippet_tests/test_scroll_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_scroll_points() { async fn scroll_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/scroll_points.rs` file use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_scroll_points_with_vectors.rs b/tests/snippet_tests/test_scroll_points_with_vectors.rs index 73ba4d0c..8bf9f6f4 100644 --- a/tests/snippet_tests/test_scroll_points_with_vectors.rs +++ b/tests/snippet_tests/test_scroll_points_with_vectors.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_scroll_points_with_vectors() { async fn scroll_points_with_vectors() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/scroll_points_with_vectors.rs` file use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_search_batch_points.rs b/tests/snippet_tests/test_search_batch_points.rs index 836546a1..0ee62eb7 100644 --- a/tests/snippet_tests/test_search_batch_points.rs +++ b/tests/snippet_tests/test_search_batch_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_search_batch_points() { async fn search_batch_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/search_batch_points.rs` file use qdrant_client::qdrant::{ Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder, }; diff --git a/tests/snippet_tests/test_search_matrix_offsets.rs b/tests/snippet_tests/test_search_matrix_offsets.rs index 276c87c3..8b83f11f 100644 --- a/tests/snippet_tests/test_search_matrix_offsets.rs +++ b/tests/snippet_tests/test_search_matrix_offsets.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_search_matrix_offsets() { async fn search_matrix_offsets() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/search_matrix_offsets.rs` file use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_search_matrix_pairs.rs b/tests/snippet_tests/test_search_matrix_pairs.rs index bc4b198d..d56a716f 100644 --- a/tests/snippet_tests/test_search_matrix_pairs.rs +++ b/tests/snippet_tests/test_search_matrix_pairs.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_search_matrix_pairs() { async fn search_matrix_pairs() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/search_matrix_pairs.rs` file use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_search_point_groups.rs b/tests/snippet_tests/test_search_point_groups.rs index 85cf8a27..ded10450 100644 --- a/tests/snippet_tests/test_search_point_groups.rs +++ b/tests/snippet_tests/test_search_point_groups.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_search_point_groups() { async fn search_point_groups() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/search_point_groups.rs` file use qdrant_client::qdrant::SearchPointGroupsBuilder; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_search_points.rs b/tests/snippet_tests/test_search_points.rs index 39b140b4..d510e3a7 100644 --- a/tests/snippet_tests/test_search_points.rs +++ b/tests/snippet_tests/test_search_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_search_points() { async fn search_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/search_points.rs` file use qdrant_client::qdrant::{AcornSearchParamsBuilder, Condition, Filter, SearchParamsBuilder, SearchPointsBuilder, ShardKey, ShardKeySelectorBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_set_payload.rs b/tests/snippet_tests/test_set_payload.rs index 293e0bb0..d0dbeff5 100644 --- a/tests/snippet_tests/test_set_payload.rs +++ b/tests/snippet_tests/test_set_payload.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_set_payload() { async fn set_payload() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/set_payload.rs` file use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder}; use qdrant_client::{Qdrant, Payload}; use serde_json::json; diff --git a/tests/snippet_tests/test_update_aliases.rs b/tests/snippet_tests/test_update_aliases.rs index cedcf782..efcb07de 100644 --- a/tests/snippet_tests/test_update_aliases.rs +++ b/tests/snippet_tests/test_update_aliases.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_update_aliases() { async fn update_aliases() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/update_aliases.rs` file use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_update_collection.rs b/tests/snippet_tests/test_update_collection.rs index 5864034e..c1b9653a 100644 --- a/tests/snippet_tests/test_update_collection.rs +++ b/tests/snippet_tests/test_update_collection.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_update_collection() { async fn update_collection() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/update_collection.rs` file use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder}; use qdrant_client::Qdrant; diff --git a/tests/snippet_tests/test_update_collection_metadata.rs b/tests/snippet_tests/test_update_collection_metadata.rs index 280bf3e6..a635ffe5 100644 --- a/tests/snippet_tests/test_update_collection_metadata.rs +++ b/tests/snippet_tests/test_update_collection_metadata.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_update_collection_metadata() { async fn update_collection_metadata() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/update_collection_metadata.rs` file use qdrant_client::qdrant::{UpdateCollectionBuilder}; use qdrant_client::Qdrant; use serde_json::{json, Value}; diff --git a/tests/snippet_tests/test_update_vectors.rs b/tests/snippet_tests/test_update_vectors.rs index 822fd3c6..68784c59 100644 --- a/tests/snippet_tests/test_update_vectors.rs +++ b/tests/snippet_tests/test_update_vectors.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_update_vectors() { async fn update_vectors() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/update_vectors.rs` file use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder}; use qdrant_client::Qdrant; use std::collections::HashMap; diff --git a/tests/snippet_tests/test_upsert_document.rs b/tests/snippet_tests/test_upsert_document.rs index 0c00ae44..c1c885d6 100644 --- a/tests/snippet_tests/test_upsert_document.rs +++ b/tests/snippet_tests/test_upsert_document.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_document() { async fn upsert_document() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_document.rs` file use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Document}; use qdrant_client::{Qdrant, Payload}; use serde_json::json; diff --git a/tests/snippet_tests/test_upsert_image.rs b/tests/snippet_tests/test_upsert_image.rs index 0d7211a6..bd439d85 100644 --- a/tests/snippet_tests/test_upsert_image.rs +++ b/tests/snippet_tests/test_upsert_image.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_image() { async fn upsert_image() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_image.rs` file use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Image}; use qdrant_client::{Qdrant, Payload}; use serde_json::json; diff --git a/tests/snippet_tests/test_upsert_points.rs b/tests/snippet_tests/test_upsert_points.rs index 28741e13..9d5543f4 100644 --- a/tests/snippet_tests/test_upsert_points.rs +++ b/tests/snippet_tests/test_upsert_points.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_points() { async fn upsert_points() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_points.rs` file use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder}; use qdrant_client::{Qdrant, Payload}; use serde_json::json; diff --git a/tests/snippet_tests/test_upsert_points_fallback_shard_key.rs b/tests/snippet_tests/test_upsert_points_fallback_shard_key.rs index 5f8ed3dc..a8d729e1 100644 --- a/tests/snippet_tests/test_upsert_points_fallback_shard_key.rs +++ b/tests/snippet_tests/test_upsert_points_fallback_shard_key.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_points_fallback_shard_key() { async fn upsert_points_fallback_shard_key() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_points_fallback_shard_key.rs` file use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, ShardKeySelectorBuilder}; use qdrant_client::{Payload, Qdrant}; use serde_json::json; diff --git a/tests/snippet_tests/test_upsert_points_insert_only.rs b/tests/snippet_tests/test_upsert_points_insert_only.rs index 9e5bb799..755b7666 100644 --- a/tests/snippet_tests/test_upsert_points_insert_only.rs +++ b/tests/snippet_tests/test_upsert_points_insert_only.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_points_insert_only() { async fn upsert_points_insert_only() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_points_insert_only.rs` file use qdrant_client::qdrant::{PointStruct, UpdateMode, UpsertPointsBuilder}; use qdrant_client::{Payload, Qdrant}; use serde_json::json; diff --git a/tests/snippet_tests/test_upsert_points_with_condition.rs b/tests/snippet_tests/test_upsert_points_with_condition.rs index 204a3d60..42fd8968 100644 --- a/tests/snippet_tests/test_upsert_points_with_condition.rs +++ b/tests/snippet_tests/test_upsert_points_with_condition.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_upsert_points_with_condition() { async fn upsert_points_with_condition() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/upsert_points_with_condition.rs` file use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Filter, Condition}; use qdrant_client::{Payload, Qdrant}; use serde_json::json; diff --git a/tests/snippet_tests/test_with_header.rs b/tests/snippet_tests/test_with_header.rs index b9934c6c..ea82245c 100644 --- a/tests/snippet_tests/test_with_header.rs +++ b/tests/snippet_tests/test_with_header.rs @@ -2,8 +2,6 @@ #[tokio::test] async fn test_with_header() { async fn with_header() -> Result<(), Box> { - // WARNING: This is a generated test snippet. - // Please, modify the snippet in the `../snippets/with_header.rs` file use qdrant_client::Qdrant; let client = Qdrant::from_url("http://localhost:6334") diff --git a/tests/snippets/batch_update.rs b/tests/snippets/batch_update.rs deleted file mode 100644 index decf523f..00000000 --- a/tests/snippets/batch_update.rs +++ /dev/null @@ -1,56 +0,0 @@ -use qdrant_client::qdrant::{ - points_selector::PointsSelectorOneOf, - points_update_operation::{ - Operation, OverwritePayload, PointStructList, UpdateVectors, - }, - PointStruct, PointVectors, PointsIdsList, PointsSelector, PointsUpdateOperation, - UpdateBatchPointsBuilder, -}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; -use std::collections::HashMap; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .update_points_batch( - UpdateBatchPointsBuilder::new( - "{collection_name}", - vec![ - PointsUpdateOperation { - operation: Some(Operation::Upsert(PointStructList { - points: vec![PointStruct::new( - 1, - vec![1.0, 2.0, 3.0, 4.0], - Payload::try_from(json!({})).unwrap(), - )], - ..Default::default() - })), - }, - PointsUpdateOperation { - operation: Some(Operation::UpdateVectors(UpdateVectors { - points: vec![PointVectors { - id: Some(1.into()), - vectors: Some(vec![1.0, 2.0, 3.0, 4.0].into()), - }], - ..Default::default() - })), - }, - PointsUpdateOperation { - operation: Some(Operation::OverwritePayload(OverwritePayload { - points_selector: Some(PointsSelector { - points_selector_one_of: Some(PointsSelectorOneOf::Points( - PointsIdsList { - ids: vec![1.into()], - }, - )), - }), - payload: HashMap::from([("test_payload".to_string(), 1.into())]), - ..Default::default() - })), - }, - ], - ) - .wait(true), - ) - .await?; diff --git a/tests/snippets/clear_payload.rs b/tests/snippets/clear_payload.rs deleted file mode 100644 index bd2d4a32..00000000 --- a/tests/snippets/clear_payload.rs +++ /dev/null @@ -1,12 +0,0 @@ -use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .clear_payload(ClearPayloadPointsBuilder::new("{collection_name}").points( - PointsIdsList { - ids: vec![0.into(), 3.into(), 100.into()], - }, - )) - .await?; diff --git a/tests/snippets/collection_exists.rs b/tests/snippets/collection_exists.rs deleted file mode 100644 index d9824f3f..00000000 --- a/tests/snippets/collection_exists.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.collection_exists("{collection_name}").await?; diff --git a/tests/snippets/count_points.rs b/tests/snippets/count_points.rs deleted file mode 100644 index 39750eaf..00000000 --- a/tests/snippets/count_points.rs +++ /dev/null @@ -1,15 +0,0 @@ -use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .count( - CountPointsBuilder::new("{collection_name}") - .filter(Filter::must([Condition::matches( - "color", - "red".to_string(), - )])) - .exact(true), - ) - .await?; diff --git a/tests/snippets/create_collection.rs b/tests/snippets/create_collection.rs deleted file mode 100644 index 774a3285..00000000 --- a/tests/snippets/create_collection.rs +++ /dev/null @@ -1,11 +0,0 @@ -use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .create_collection( - CreateCollectionBuilder::new("{collection_name}") - .vectors_config(VectorParamsBuilder::new(100, Distance::Cosine)), - ) - .await?; diff --git a/tests/snippets/create_collection_with_bq.rs b/tests/snippets/create_collection_with_bq.rs deleted file mode 100644 index fde5754a..00000000 --- a/tests/snippets/create_collection_with_bq.rs +++ /dev/null @@ -1,18 +0,0 @@ -use qdrant_client::qdrant::{ - BinaryQuantizationBuilder, BinaryQuantizationEncoding, CreateCollectionBuilder, Distance, VectorParamsBuilder, BinaryQuantizationQueryEncoding, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .create_collection( - CreateCollectionBuilder::new("{collection_name}") - .vectors_config(VectorParamsBuilder::new(1536, Distance::Cosine)) - .quantization_config( - BinaryQuantizationBuilder::new(true) - .encoding(BinaryQuantizationEncoding::TwoBits) - .query_encoding(BinaryQuantizationQueryEncoding::scalar8bits()) - ), - ) - .await?; \ No newline at end of file diff --git a/tests/snippets/create_collection_with_metadata.rs b/tests/snippets/create_collection_with_metadata.rs deleted file mode 100644 index e3bd1b19..00000000 --- a/tests/snippets/create_collection_with_metadata.rs +++ /dev/null @@ -1,20 +0,0 @@ -use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder}; -use qdrant_client::Qdrant; -use serde_json::{json, Value}; -use std::collections::HashMap; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - - -let mut metadata: HashMap = HashMap::new(); -metadata.insert("my-metadata-field".to_string(), json!("value-1")); -metadata.insert("another-field".to_string(), json!(123)); - - -client - .create_collection( - CreateCollectionBuilder::new("{collection_name}") - .vectors_config(VectorParamsBuilder::new(100, Distance::Cosine)) - .metadata(metadata), - ) - .await?; diff --git a/tests/snippets/create_field_index.rs b/tests/snippets/create_field_index.rs deleted file mode 100644 index 86aa7125..00000000 --- a/tests/snippets/create_field_index.rs +++ /dev/null @@ -1,14 +0,0 @@ -use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .create_field_index( - CreateFieldIndexCollectionBuilder::new( - "{collection_name}", - "{field_name}", - FieldType::Keyword, - ), - ) - .await?; diff --git a/tests/snippets/create_full_snapshot.rs b/tests/snippets/create_full_snapshot.rs deleted file mode 100644 index 4088ed26..00000000 --- a/tests/snippets/create_full_snapshot.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.create_full_snapshot().await?; diff --git a/tests/snippets/create_shard_key.rs b/tests/snippets/create_shard_key.rs deleted file mode 100644 index 6559eb74..00000000 --- a/tests/snippets/create_shard_key.rs +++ /dev/null @@ -1,16 +0,0 @@ -use qdrant_client::qdrant::shard_key::Key; -use qdrant_client::qdrant::{CreateShardKeyBuilder, CreateShardKeyRequestBuilder}; -use qdrant_client::qdrant::ReplicaState; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .create_shard_key( - CreateShardKeyRequestBuilder::new("{collection_name}").request( - CreateShardKeyBuilder::default() - .shard_key(Key::Keyword("{shard_key}".to_string())) - .initial_state(ReplicaState::Active), - ), - ) - .await?; diff --git a/tests/snippets/create_snapshot.rs b/tests/snippets/create_snapshot.rs deleted file mode 100644 index 9e24a7f8..00000000 --- a/tests/snippets/create_snapshot.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.create_snapshot("{collection_name}").await?; diff --git a/tests/snippets/create_text_index.rs b/tests/snippets/create_text_index.rs deleted file mode 100644 index 8005cdc7..00000000 --- a/tests/snippets/create_text_index.rs +++ /dev/null @@ -1,24 +0,0 @@ -use qdrant_client::qdrant::{ - CreateFieldIndexCollectionBuilder, - TextIndexParamsBuilder, - FieldType, - TokenizerType, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let text_index_params = TextIndexParamsBuilder::new(TokenizerType::Word) - .min_token_len(2) - .max_token_len(10) - .lowercase(true); - -client - .create_field_index( - CreateFieldIndexCollectionBuilder::new( - "{collection_name}", - "{field_name}", - FieldType::Text, - ).field_index_params(text_index_params.build()), - ) - .await?; \ No newline at end of file diff --git a/tests/snippets/delete_collection.rs b/tests/snippets/delete_collection.rs deleted file mode 100644 index c159486e..00000000 --- a/tests/snippets/delete_collection.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.delete_collection("{collection_name}").await?; diff --git a/tests/snippets/delete_field_index.rs b/tests/snippets/delete_field_index.rs deleted file mode 100644 index e52dbdfa..00000000 --- a/tests/snippets/delete_field_index.rs +++ /dev/null @@ -1,11 +0,0 @@ -use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_field_index(DeleteFieldIndexCollectionBuilder::new( - "{collection_name}", - "{field_name}", - )) - .await?; diff --git a/tests/snippets/delete_full_snapshot.rs b/tests/snippets/delete_full_snapshot.rs deleted file mode 100644 index 58c5838e..00000000 --- a/tests/snippets/delete_full_snapshot.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.delete_full_snapshot("{snapshot_name}").await?; diff --git a/tests/snippets/delete_payload.rs b/tests/snippets/delete_payload.rs deleted file mode 100644 index 74549d9c..00000000 --- a/tests/snippets/delete_payload.rs +++ /dev/null @@ -1,17 +0,0 @@ -use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_payload( - DeletePayloadPointsBuilder::new( - "{collection_name}", - vec!["color".to_string(), "price".to_string()], - ) - .points_selector(PointsIdsList { - ids: vec![0.into(), 3.into(), 100.into()], - }) - .wait(true), - ) - .await?; diff --git a/tests/snippets/delete_points.rs b/tests/snippets/delete_points.rs deleted file mode 100644 index 2bed7053..00000000 --- a/tests/snippets/delete_points.rs +++ /dev/null @@ -1,25 +0,0 @@ -use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_points( - DeletePointsBuilder::new("{collection_name}") - .points(PointsIdsList { - ids: vec![0.into(), 3.into(), 100.into()], - }) - .wait(true), - ) - .await?; - -client - .delete_points( - DeletePointsBuilder::new("{collection_name}") - .points(Filter::must([Condition::matches( - "color", - "red".to_string(), - )])) - .wait(true), - ) - .await?; diff --git a/tests/snippets/delete_shard_key.rs b/tests/snippets/delete_shard_key.rs deleted file mode 100644 index 67283fa3..00000000 --- a/tests/snippets/delete_shard_key.rs +++ /dev/null @@ -1,12 +0,0 @@ -use qdrant_client::qdrant::shard_key::Key; -use qdrant_client::qdrant::DeleteShardKeyRequestBuilder; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_shard_key( - DeleteShardKeyRequestBuilder::new("{collection_name}") - .key(Key::Keyword("{shard_key}".to_string())), - ) - .await?; diff --git a/tests/snippets/delete_snapshot.rs b/tests/snippets/delete_snapshot.rs deleted file mode 100644 index f6700cc2..00000000 --- a/tests/snippets/delete_snapshot.rs +++ /dev/null @@ -1,11 +0,0 @@ -use qdrant_client::qdrant::DeleteSnapshotRequestBuilder; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_snapshot(DeleteSnapshotRequestBuilder::new( - "{collection_name}", - "{snapshot_name}", - )) - .await?; diff --git a/tests/snippets/delete_vectors.rs b/tests/snippets/delete_vectors.rs deleted file mode 100644 index 68dcc4e5..00000000 --- a/tests/snippets/delete_vectors.rs +++ /dev/null @@ -1,17 +0,0 @@ -use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList, VectorsSelector}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .delete_vectors( - DeletePointVectorsBuilder::new("{collection_name}") - .points_selector(PointsIdsList { - ids: vec![0.into(), 3.into(), 10.into()], - }) - .vectors(VectorsSelector { - names: vec!["text".into(), "image".into()], - }) - .wait(true), - ) - .await?; diff --git a/tests/snippets/discover_batch_points.rs b/tests/snippets/discover_batch_points.rs deleted file mode 100644 index efdfd75e..00000000 --- a/tests/snippets/discover_batch_points.rs +++ /dev/null @@ -1,45 +0,0 @@ -use qdrant_client::qdrant::{ - vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder, - DiscoverPointsBuilder, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let discover_points = DiscoverBatchPointsBuilder::new( - "{collection_name}", - vec![ - DiscoverPointsBuilder::new( - "{collection_name}", - vec![ - ContextExamplePairBuilder::default() - .positive(Example::Id(100.into())) - .negative(Example::Id(718.into())) - .build(), - ContextExamplePairBuilder::default() - .positive(Example::Id(200.into())) - .negative(Example::Id(300.into())) - .build(), - ], - 10, - ) - .build(), - DiscoverPointsBuilder::new( - "{collection_name}", - vec![ - ContextExamplePairBuilder::default() - .positive(Example::Id(342.into())) - .negative(Example::Id(213.into())) - .build(), - ContextExamplePairBuilder::default() - .positive(Example::Id(100.into())) - .negative(Example::Id(200.into())) - .build(), - ], - 10, - ) - .build(), - ], -); - -client.discover_batch(&discover_points.build()).await?; diff --git a/tests/snippets/discover_points.rs b/tests/snippets/discover_points.rs deleted file mode 100644 index 2cc7e2d8..00000000 --- a/tests/snippets/discover_points.rs +++ /dev/null @@ -1,29 +0,0 @@ -use qdrant_client::qdrant::{ - target_vector::Target, vector_example::Example, ContextExamplePairBuilder, - DiscoverPointsBuilder, VectorExample, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .discover( - DiscoverPointsBuilder::new( - "{collection_name}", - vec![ - ContextExamplePairBuilder::default() - .positive(Example::Id(100.into())) - .negative(Example::Id(718.into())) - .build(), - ContextExamplePairBuilder::default() - .positive(Example::Id(200.into())) - .negative(Example::Id(300.into())) - .build(), - ], - 10, - ) - .target(Target::Single(VectorExample { - example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())), - })), - ) - .await?; diff --git a/tests/snippets/facets.rs b/tests/snippets/facets.rs deleted file mode 100644 index aea1be7a..00000000 --- a/tests/snippets/facets.rs +++ /dev/null @@ -1,15 +0,0 @@ -use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .facet( - FacetCountsBuilder::new("world_data", "country") - .limit(10) - .filter(Filter::must(vec![Condition::matches( - "continent", - "Europe".to_string(), - )])), - ) - .await?; diff --git a/tests/snippets/get_collection.rs b/tests/snippets/get_collection.rs deleted file mode 100644 index fa3ca1e2..00000000 --- a/tests/snippets/get_collection.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.collection_info("{collection_name}").await?; diff --git a/tests/snippets/get_collection_aliases.rs b/tests/snippets/get_collection_aliases.rs deleted file mode 100644 index 7b9c9a2e..00000000 --- a/tests/snippets/get_collection_aliases.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.list_collection_aliases("{collection_name}").await?; diff --git a/tests/snippets/get_collections.rs b/tests/snippets/get_collections.rs deleted file mode 100644 index c04e2212..00000000 --- a/tests/snippets/get_collections.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.list_collections().await?; diff --git a/tests/snippets/get_collections_aliases.rs b/tests/snippets/get_collections_aliases.rs deleted file mode 100644 index 9864b2a9..00000000 --- a/tests/snippets/get_collections_aliases.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.list_aliases().await?; diff --git a/tests/snippets/get_points.rs b/tests/snippets/get_points.rs deleted file mode 100644 index 37e21d8e..00000000 --- a/tests/snippets/get_points.rs +++ /dev/null @@ -1,11 +0,0 @@ -use qdrant_client::qdrant::GetPointsBuilder; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .get_points(GetPointsBuilder::new( - "{collection_name}", - vec![0.into(), 30.into(), 100.into()], - )) - .await?; diff --git a/tests/snippets/list_full_snapshots.rs b/tests/snippets/list_full_snapshots.rs deleted file mode 100644 index e0eda88c..00000000 --- a/tests/snippets/list_full_snapshots.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.list_full_snapshots().await?; diff --git a/tests/snippets/list_shard_keys.rs b/tests/snippets/list_shard_keys.rs deleted file mode 100644 index 2e0dd0e6..00000000 --- a/tests/snippets/list_shard_keys.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let _response = client.list_shard_keys("{collection_name}").await?; diff --git a/tests/snippets/list_snapshots.rs b/tests/snippets/list_snapshots.rs deleted file mode 100644 index d594b6c8..00000000 --- a/tests/snippets/list_snapshots.rs +++ /dev/null @@ -1,5 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.list_snapshots("{collection_name}").await?; diff --git a/tests/snippets/overwrite_payload.rs b/tests/snippets/overwrite_payload.rs deleted file mode 100644 index d22330fc..00000000 --- a/tests/snippets/overwrite_payload.rs +++ /dev/null @@ -1,24 +0,0 @@ -use qdrant_client::qdrant::{ - points_selector::PointsSelectorOneOf, PointsIdsList, SetPayloadPointsBuilder, -}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let payload: Payload = json!({ - "property1": "string", - "property2": "string", -}) -.try_into() -.unwrap(); - -client - .overwrite_payload( - SetPayloadPointsBuilder::new("{collection_name}", payload) - .points_selector(PointsSelectorOneOf::Points(PointsIdsList { - ids: vec![0.into(), 3.into(), 10.into()], - })) - .wait(true), - ) - .await?; diff --git a/tests/snippets/query_document.rs b/tests/snippets/query_document.rs deleted file mode 100644 index bf0df6f6..00000000 --- a/tests/snippets/query_document.rs +++ /dev/null @@ -1,16 +0,0 @@ -use qdrant_client::qdrant::{Document, Query, QueryPointsBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let query_document = Document::new( - "my query text", - "sentence-transformers/all-minilm-l6-v2" -); - -let query_request = QueryPointsBuilder::new("{collection_name}") - .query(Query::new_nearest(query_document)); - -// ANN search with server-side inference -client.query(query_request).await?; - diff --git a/tests/snippets/query_image.rs b/tests/snippets/query_image.rs deleted file mode 100644 index ed462986..00000000 --- a/tests/snippets/query_image.rs +++ /dev/null @@ -1,16 +0,0 @@ -use qdrant_client::qdrant::{Image, Query, QueryPointsBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let query_image = Image::new_from_url( - "https://picsum.photos/200/300.jpg", - "Qdrant/clip-ViT-B-32-vision" -); - -let query_request = QueryPointsBuilder::new("{collection_name}") - .query(Query::new_nearest(query_image)); - -// ANN search with server-side inference -client.query(query_request).await?; - diff --git a/tests/snippets/query_points.rs b/tests/snippets/query_points.rs deleted file mode 100644 index 307a46fc..00000000 --- a/tests/snippets/query_points.rs +++ /dev/null @@ -1,173 +0,0 @@ -use qdrant_client::qdrant::{ - AcornSearchParamsBuilder, Condition, DecayParamsExpressionBuilder, Expression, - Filter, FormulaBuilder, Fusion, GeoPoint, - PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder, - RecommendInputBuilder, RrfBuilder, Sample, - SearchParamsBuilder, ShardKey, ShardKeySelectorBuilder, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -// Query nearest by ID -let _nearest = client.query( - QueryPointsBuilder::new("{collection_name}") - .query(PointId::from("43cf51e2-8777-4f52-bc74-c2cbde0c8b04")) -).await?; - -// Recommend on the average of these vectors -let _recommendations = client.query( - QueryPointsBuilder::new("{collection_name}") - .query(Query::new_recommend( - RecommendInputBuilder::default() - .add_positive(vec![0.1; 8]) - .add_negative(PointId::from(0)) - )) -).await?; - -// Fusion query -let _hybrid = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![(1, 0.22), (42, 0.8)]) - .using("sparse") - .limit(20u64) - ) - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .using("dense") - .limit(20u64) - ) - .query(Fusion::Rrf) -).await?; - -// 2-stage query -let _refined = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .limit(100u64) - ) - .query(vec![ - vec![0.1, 0.2], - vec![0.2, 0.1], - vec![0.8, 0.9], - ]) - .using("colbert") - .limit(10u64) -).await?; - -// Random sampling (as of 1.11.0) -let _sampled = client - .query( - QueryPointsBuilder::new("{collection_name}") - .query(Query::new_sample(Sample::Random)) - ) - .await?; - -// Score boost depending on payload conditions (as of 1.14.0) -let _tag_boosted = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .limit(100u64) - ) - .query(FormulaBuilder::new(Expression::sum_with([ - Expression::score(), - Expression::mult_with([ - Expression::constant(0.5), - Expression::condition(Condition::matches("tag", ["h1", "h2", "h3", "h4"])), - ]), - Expression::mult_with([ - Expression::constant(0.25), - Expression::condition(Condition::matches("tag", ["p", "li"])), - ]), - ]))) - .limit(10) -).await?; - -// Score boost geographically closer points (as of 1.14.0) -let _geo_boosted = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch( - PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .limit(100u64), - ) - .query( - FormulaBuilder::new(Expression::sum_with([ - Expression::score(), - Expression::exp_decay( - DecayParamsExpressionBuilder::new(Expression::geo_distance_with( - // Berlin - GeoPoint { lat: 52.504043, lon: 13.393236 }, - "geo.location", - )) - .scale(5_000.0), - ), - ])) - // Munich - .add_default("geo.location", GeoPoint { lat: 48.137154, lon: 11.576124 }), - ) - .limit(10), - ) - .await?; - -// RRF fusion query using Query::new_rrf constructor -let _rrf_hybrid = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![(1, 0.22), (42, 0.8)]) - .using("sparse") - .limit(20u64) - ) - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .using("dense") - .limit(20u64) - ) - .query(Query::new_rrf(RrfBuilder::new())) -).await?; - -// RRF with custom k parameter -let _rrf_custom = client.query( - QueryPointsBuilder::new("{collection_name}") - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![(1, 0.22), (42, 0.8)]) - .using("sparse") - .limit(20u64) - ) - .add_prefetch(PrefetchQueryBuilder::default() - .query(vec![0.01, 0.45, 0.67]) - .using("dense") - .limit(20u64) - ) - .query(Query::new_rrf(RrfBuilder::with_k(100))) -).await?; - -// Query with ACORN enabled for filtered query -let _acorn_query = client.query( - QueryPointsBuilder::new("{collection_name}") - .query(vec![0.01, 0.45, 0.67]) - .filter(Filter::must([Condition::matches( - "category", - "electronics".to_string(), - )])) - .params( - SearchParamsBuilder::default() - .hnsw_ef(128) - .acorn(AcornSearchParamsBuilder::new(true).max_selectivity(0.4)) - ) - .limit(10u64) -).await?; - -// Query in specific shards with fallback -let _shard_query = client.query( - QueryPointsBuilder::new("{collection_name}") - .query(vec![0.01, 0.45, 0.67]) - .shard_key_selector( - ShardKeySelectorBuilder::with_shard_keys(vec![ShardKey::from("shard_1".to_string())]) - .fallback(ShardKey::from("shard_backup".to_string())) - ) - .limit(10u64) -).await?; diff --git a/tests/snippets/query_points_groups.rs b/tests/snippets/query_points_groups.rs deleted file mode 100644 index 57269658..00000000 --- a/tests/snippets/query_points_groups.rs +++ /dev/null @@ -1,11 +0,0 @@ -use qdrant_client::Qdrant; -use qdrant_client::qdrant::{Query, QueryPointGroupsBuilder}; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client.query_groups( - QueryPointGroupsBuilder::new("{collection_name}", "document_id") - .query(Query::from(vec![0.01, 0.45, 0.67])) - .limit(10u64) - .group_size(5u64) -).await?; diff --git a/tests/snippets/query_points_relevance_feedback.rs b/tests/snippets/query_points_relevance_feedback.rs deleted file mode 100644 index f4433c50..00000000 --- a/tests/snippets/query_points_relevance_feedback.rs +++ /dev/null @@ -1,19 +0,0 @@ -use qdrant_client::qdrant::{ - FeedbackItemBuilder, FeedbackStrategyBuilder, PointId, Query, QueryPointsBuilder, - RelevanceFeedbackInputBuilder, VectorInput, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -// Relevance feedback query (as of 1.17.0) -let _feedback = client.query( - QueryPointsBuilder::new("{collection_name}") - .query(Query::new_relevance_feedback( - RelevanceFeedbackInputBuilder::new(vec![0.01, 0.45, 0.67]) - .add_feedback(FeedbackItemBuilder::new(VectorInput::new_id(PointId::from(42)), 0.9)) - .add_feedback(FeedbackItemBuilder::new(VectorInput::new_id(PointId::from(7)), 0.1)) - .strategy(FeedbackStrategyBuilder::naive(1.0, 1.0, 1.0)) - )) - .limit(10u64) -).await?; diff --git a/tests/snippets/recommend_batch_points.rs b/tests/snippets/recommend_batch_points.rs deleted file mode 100644 index 5d6abfd3..00000000 --- a/tests/snippets/recommend_batch_points.rs +++ /dev/null @@ -1,29 +0,0 @@ -use qdrant_client::qdrant::{ - Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let filter = Filter::must([Condition::matches("city", "London".to_string())]); -let recommend_queries = vec![ - RecommendPointsBuilder::new("{collection_name}", 3) - .add_positive(100) - .add_positive(231) - .add_negative(718) - .filter(filter.clone()) - .build(), - RecommendPointsBuilder::new("{collection_name}", 3) - .add_positive(200) - .add_positive(67) - .add_negative(300) - .filter(filter.clone()) - .build(), -]; - -client - .recommend_batch(RecommendBatchPointsBuilder::new( - "{collection_name}", - recommend_queries, - )) - .await?; diff --git a/tests/snippets/recommend_point_groups.rs b/tests/snippets/recommend_point_groups.rs deleted file mode 100644 index d37e9a87..00000000 --- a/tests/snippets/recommend_point_groups.rs +++ /dev/null @@ -1,14 +0,0 @@ -use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .recommend_groups( - RecommendPointGroupsBuilder::new("{collection_name}", "document_id", 2, 3) - .add_positive(100) - .add_positive(200) - .add_negative(718) - .strategy(RecommendStrategy::AverageVector), - ) - .await?; diff --git a/tests/snippets/recommend_points.rs b/tests/snippets/recommend_points.rs deleted file mode 100644 index c22ef539..00000000 --- a/tests/snippets/recommend_points.rs +++ /dev/null @@ -1,20 +0,0 @@ -use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .recommend( - RecommendPointsBuilder::new("{collection_name}", 3) - .add_positive(100) - .add_positive(200) - .add_positive(vec![100.0, 231.0]) - .add_negative(718) - .add_negative(vec![0.2, 0.3, 0.4, 0.5]) - .strategy(RecommendStrategy::AverageVector) - .filter(Filter::must([Condition::matches( - "city", - "London".to_string(), - )])), - ) - .await?; diff --git a/tests/snippets/replicate_points.rs b/tests/snippets/replicate_points.rs deleted file mode 100644 index 9d786a4f..00000000 --- a/tests/snippets/replicate_points.rs +++ /dev/null @@ -1,25 +0,0 @@ -use qdrant_client::qdrant::{ - update_collection_cluster_setup_request::Operation, Condition, Filter, - ReplicatePointsBuilder, ShardKey, UpdateCollectionClusterSetupRequest, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .update_collection_cluster_setup(UpdateCollectionClusterSetupRequest { - collection_name: "{collection_name}".to_string(), - operation: Some(Operation::ReplicatePoints( - ReplicatePointsBuilder::new( - ShardKey::from("source_shard"), - ShardKey::from("target_shard"), - ) - .filter(Filter::must([Condition::matches( - "user", - "tenant-123".to_string(), - )])) - .build(), - )), - timeout: None, - }) - .await?; diff --git a/tests/snippets/scroll_points.rs b/tests/snippets/scroll_points.rs deleted file mode 100644 index 28458624..00000000 --- a/tests/snippets/scroll_points.rs +++ /dev/null @@ -1,29 +0,0 @@ -use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .scroll( - ScrollPointsBuilder::new("{collection_name}") - .filter(Filter::must([Condition::matches( - "color", - "red".to_string(), - )])) - .limit(1) - .with_payload(true) - .with_vectors(false), - ) - .await?; - -// Filter points matching any of the text words -client - .scroll( - ScrollPointsBuilder::new("{collection_name}") - .filter(Filter::must([Condition::matches_text_any( - "description", - "machine learning artificial intelligence", - )])) - .limit(10u32), - ) - .await?; diff --git a/tests/snippets/scroll_points_with_vectors.rs b/tests/snippets/scroll_points_with_vectors.rs deleted file mode 100644 index a0da2859..00000000 --- a/tests/snippets/scroll_points_with_vectors.rs +++ /dev/null @@ -1,22 +0,0 @@ -use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let scroll_response = client - .scroll( - ScrollPointsBuilder::new("{collection_name}") - .filter(Filter::must([Condition::matches( - "color", - "red".to_string(), - )])) - .limit(1) - .with_payload(true) - .with_vectors(true), - ) - .await?; - -for point in scroll_response.result { - let vector = point.vectors.unwrap().get_vector(); - println!("vector: {vector:?}"); -} \ No newline at end of file diff --git a/tests/snippets/search_batch_points.rs b/tests/snippets/search_batch_points.rs deleted file mode 100644 index 145f60dd..00000000 --- a/tests/snippets/search_batch_points.rs +++ /dev/null @@ -1,21 +0,0 @@ -use qdrant_client::qdrant::{ - Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder, -}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let filter = Filter::must([Condition::matches("city", "London".to_string())]); - -let searches = vec![ - SearchPointsBuilder::new("{collection_name}", vec![0.2, 0.1, 0.9, 0.7], 3) - .filter(filter.clone()) - .build(), - SearchPointsBuilder::new("{collection_name}", vec![0.5, 0.3, 0.2, 0.3], 3) - .filter(filter.clone()) - .build(), -]; - -client - .search_batch_points(SearchBatchPointsBuilder::new("{collection_name}", searches)) - .await?; diff --git a/tests/snippets/search_matrix_offsets.rs b/tests/snippets/search_matrix_offsets.rs deleted file mode 100644 index 1e9980fa..00000000 --- a/tests/snippets/search_matrix_offsets.rs +++ /dev/null @@ -1,16 +0,0 @@ -use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .search_matrix_offsets( - SearchMatrixPointsBuilder::new("collection_name") - .filter(Filter::must(vec![Condition::matches( - "color", - "red".to_string(), - )])) - .sample(1000) - .limit(10), - ) - .await?; diff --git a/tests/snippets/search_matrix_pairs.rs b/tests/snippets/search_matrix_pairs.rs deleted file mode 100644 index a72dc48d..00000000 --- a/tests/snippets/search_matrix_pairs.rs +++ /dev/null @@ -1,16 +0,0 @@ -use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .search_matrix_pairs( - SearchMatrixPointsBuilder::new("collection_name") - .filter(Filter::must(vec![Condition::matches( - "color", - "red".to_string(), - )])) - .sample(1000) - .limit(10), - ) - .await?; diff --git a/tests/snippets/search_point_groups.rs b/tests/snippets/search_point_groups.rs deleted file mode 100644 index 84cd91e1..00000000 --- a/tests/snippets/search_point_groups.rs +++ /dev/null @@ -1,14 +0,0 @@ -use qdrant_client::qdrant::SearchPointGroupsBuilder; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .search_groups(SearchPointGroupsBuilder::new( - "{collection_name}", - vec![1.1], - 4, - "document_id", - 2, - )) - .await?; diff --git a/tests/snippets/search_points.rs b/tests/snippets/search_points.rs deleted file mode 100644 index e2ca3325..00000000 --- a/tests/snippets/search_points.rs +++ /dev/null @@ -1,42 +0,0 @@ -use qdrant_client::qdrant::{AcornSearchParamsBuilder, Condition, Filter, SearchParamsBuilder, SearchPointsBuilder, ShardKey, ShardKeySelectorBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .search_points( - SearchPointsBuilder::new("{collection_name}", vec![0.2, 0.1, 0.9, 0.7], 3) - .filter(Filter::must([Condition::matches( - "city", - "London".to_string(), - )])) - .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)), - ) - .await?; - -// Search with ACORN enabled for filtered search -client - .search_points( - SearchPointsBuilder::new("{collection_name}", vec![0.2, 0.1, 0.9, 0.7], 3) - .filter(Filter::must([Condition::matches( - "city", - "London".to_string(), - )])) - .params( - SearchParamsBuilder::default() - .hnsw_ef(128) - .acorn(AcornSearchParamsBuilder::new(true).max_selectivity(0.4)) - ), - ) - .await?; - -// Search in specific shards with fallback -client - .search_points( - SearchPointsBuilder::new("{collection_name}", vec![0.2, 0.1, 0.9, 0.7], 3) - .shard_key_selector( - ShardKeySelectorBuilder::with_shard_keys(vec![ShardKey::from("shard_1".to_string())]) - .fallback(ShardKey::from("shard_backup".to_string())) - ), - ) - .await?; diff --git a/tests/snippets/set_payload.rs b/tests/snippets/set_payload.rs deleted file mode 100644 index 0814096f..00000000 --- a/tests/snippets/set_payload.rs +++ /dev/null @@ -1,22 +0,0 @@ -use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let payload: Payload = json!({ - "property1": "string", - "property2": "string", -}) -.try_into() -.unwrap(); - -client - .set_payload( - SetPayloadPointsBuilder::new("{collection_name}", payload) - .points_selector(PointsIdsList { - ids: vec![0.into(), 3.into(), 10.into()], - }) - .wait(true), - ) - .await?; diff --git a/tests/snippets/update_aliases.rs b/tests/snippets/update_aliases.rs deleted file mode 100644 index 98ed9fcb..00000000 --- a/tests/snippets/update_aliases.rs +++ /dev/null @@ -1,17 +0,0 @@ -use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .create_alias(CreateAliasBuilder::new( - "example_collection", - "production_collection", - )) - .await?; - -client - .delete_alias(DeleteAlias { - alias_name: "production_collection".to_string(), - }) - .await?; diff --git a/tests/snippets/update_collection.rs b/tests/snippets/update_collection.rs deleted file mode 100644 index 3a5c4558..00000000 --- a/tests/snippets/update_collection.rs +++ /dev/null @@ -1,12 +0,0 @@ -use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder}; -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .update_collection( - UpdateCollectionBuilder::new("{collection_name}").optimizers_config( - OptimizersConfigDiffBuilder::default().indexing_threshold(10_000), - ), - ) - .await?; diff --git a/tests/snippets/update_collection_metadata.rs b/tests/snippets/update_collection_metadata.rs deleted file mode 100644 index 914f7b1a..00000000 --- a/tests/snippets/update_collection_metadata.rs +++ /dev/null @@ -1,18 +0,0 @@ -use qdrant_client::qdrant::{UpdateCollectionBuilder}; -use qdrant_client::Qdrant; -use serde_json::{json, Value}; -use std::collections::HashMap; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let mut metadata: HashMap = HashMap::new(); -metadata.insert("my-metadata-field".to_string(), json!({ - "key-a": "value-a", - "key-b": 42 -})); - -client - .update_collection( - UpdateCollectionBuilder::new("{collection_name}").metadata(metadata), - ) - .await?; diff --git a/tests/snippets/update_vectors.rs b/tests/snippets/update_vectors.rs deleted file mode 100644 index 1e7e8b6b..00000000 --- a/tests/snippets/update_vectors.rs +++ /dev/null @@ -1,33 +0,0 @@ -use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder}; -use qdrant_client::Qdrant; -use std::collections::HashMap; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .update_vectors( - UpdatePointVectorsBuilder::new( - "{collection_name}", - vec![ - PointVectors { - id: Some(1.into()), - vectors: Some( - HashMap::from([("image".to_string(), vec![0.1, 0.2, 0.3, 0.4])]) - .into(), - ), - }, - PointVectors { - id: Some(2.into()), - vectors: Some( - HashMap::from([( - "text".to_string(), - vec![0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2], - )]) - .into(), - ), - }, - ], - ) - .wait(true), - ) - .await?; diff --git a/tests/snippets/upsert_document.rs b/tests/snippets/upsert_document.rs deleted file mode 100644 index 43a67590..00000000 --- a/tests/snippets/upsert_document.rs +++ /dev/null @@ -1,26 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Document}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let document = Document::new("my document", "sentence-transformers/all-minilm-l6-v2"); - -client - .upsert_points( - UpsertPointsBuilder::new( - "{collection_name}", - vec![ - PointStruct::new( - 1, - document, - Payload::try_from(json!( - {"color": "red"} - )) - .unwrap(), - ) - ], - ) - .wait(true), - ) - .await?; diff --git a/tests/snippets/upsert_image.rs b/tests/snippets/upsert_image.rs deleted file mode 100644 index a7ed2b5f..00000000 --- a/tests/snippets/upsert_image.rs +++ /dev/null @@ -1,26 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Image}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let image = Image::new_from_url("https://picsum.photos/200/300.jpg", "Qdrant/clip-ViT-B-32-vision"); - -client - .upsert_points( - UpsertPointsBuilder::new( - "{collection_name}", - vec![ - PointStruct::new( - 1, - image, - Payload::try_from(json!( - {"color": "red"} - )) - .unwrap(), - ) - ], - ) - .wait(true), - ) - .await?; diff --git a/tests/snippets/upsert_points.rs b/tests/snippets/upsert_points.rs deleted file mode 100644 index cdf571ff..00000000 --- a/tests/snippets/upsert_points.rs +++ /dev/null @@ -1,40 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder}; -use qdrant_client::{Qdrant, Payload}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -client - .upsert_points( - UpsertPointsBuilder::new( - "{collection_name}", - vec![ - PointStruct::new( - 1, - vec![0.9, 0.1, 0.1], - Payload::try_from(json!( - {"color": "red"} - )) - .unwrap(), - ), - PointStruct::new( - 2, - vec![0.1, 0.9, 0.1], - Payload::try_from(json!( - {"color": "green"} - )) - .unwrap(), - ), - PointStruct::new( - 3, - vec![0.1, 0.1, 0.9], - Payload::try_from(json!( - {"color": "blue"} - )) - .unwrap(), - ), - ], - ) - .wait(true), - ) - .await?; diff --git a/tests/snippets/upsert_points_fallback_shard_key.rs b/tests/snippets/upsert_points_fallback_shard_key.rs deleted file mode 100644 index cd2ea764..00000000 --- a/tests/snippets/upsert_points_fallback_shard_key.rs +++ /dev/null @@ -1,29 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, ShardKeySelectorBuilder}; -use qdrant_client::{Payload, Qdrant}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let points = vec![ - PointStruct::new( - 1, - vec![0.05, 0.61, 0.76, 0.74], - Payload::try_from(json!({ - "city": "Berlin", - "price": 1.99, - "version": 3 - })).unwrap(), - ) -]; - -let shard_key_selector = ShardKeySelectorBuilder::with_shard_key("tenant-123") - .fallback("default") - .add_shard_key("tenant-123") - .build(); - -client - .upsert_points( - UpsertPointsBuilder::new("{collection_name}", points) - .wait(true) - .shard_key_selector(shard_key_selector) - ).await?; diff --git a/tests/snippets/upsert_points_insert_only.rs b/tests/snippets/upsert_points_insert_only.rs deleted file mode 100644 index d844971c..00000000 --- a/tests/snippets/upsert_points_insert_only.rs +++ /dev/null @@ -1,24 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpdateMode, UpsertPointsBuilder}; -use qdrant_client::{Payload, Qdrant}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let points = vec![PointStruct::new( - 1, - vec![0.05, 0.61, 0.76, 0.74], - Payload::try_from(json!({ - "city": "Berlin", - "price": 1.99, - })) - .unwrap(), -)]; - -// Only insert new points, do not update existing ones -client - .upsert_points( - UpsertPointsBuilder::new("{collection_name}", points) - .wait(true) - .update_mode(UpdateMode::InsertOnly), - ) - .await?; diff --git a/tests/snippets/upsert_points_with_condition.rs b/tests/snippets/upsert_points_with_condition.rs deleted file mode 100644 index 1f4a15d1..00000000 --- a/tests/snippets/upsert_points_with_condition.rs +++ /dev/null @@ -1,24 +0,0 @@ -use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Filter, Condition}; -use qdrant_client::{Payload, Qdrant}; -use serde_json::json; - -let client = Qdrant::from_url("http://localhost:6334").build()?; - -let points = vec![ - PointStruct::new( - 1, - vec![0.05, 0.61, 0.76, 0.74], - Payload::try_from(json!({ - "city": "Berlin", - "price": 1.99, - "version": 3 - })).unwrap(), - ) -]; - -client - .upsert_points( - UpsertPointsBuilder::new("{collection_name}", points) - .wait(true) - .update_filter(Filter::must([Condition::matches("version", 2)])) - ).await?; \ No newline at end of file diff --git a/tests/snippets/with_header.rs b/tests/snippets/with_header.rs deleted file mode 100644 index 161a982b..00000000 --- a/tests/snippets/with_header.rs +++ /dev/null @@ -1,22 +0,0 @@ -use qdrant_client::Qdrant; - -let client = Qdrant::from_url("http://localhost:6334") - .header("x-base", "base-value") - .skip_compatibility_check() - .build() - .unwrap(); - -let traced = client.with_header("x-request-id", "abc-123"); - -assert_eq!( - traced.config.custom_headers, - vec![ - ("x-base".to_string(), "base-value".to_string()), - ("x-request-id".to_string(), "abc-123".to_string()), - ] -); -// Original still has only the base header -assert_eq!( - client.config.custom_headers, - vec![("x-base".to_string(), "base-value".to_string())] -); \ No newline at end of file