From b1b775ef78d26fbe8b47dce5233bfe47fecdd5bb Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 23 Jan 2026 10:24:43 +0100 Subject: [PATCH 1/6] Migrate search example in docs to query --- src/lib.rs | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4d4d15e6..de244e30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,37 +86,41 @@ //! //! Documentation: //! -//! # Search +//! # Query (search) //! //! Finally, we can retrieve points in various ways, the common one being a plain similarity //! search: //! //! ```no_run //!# use qdrant_client::{Qdrant, QdrantError}; -//! use qdrant_client::qdrant::SearchPointsBuilder; +//! use qdrant_client::qdrant::QueryPointsBuilder; //! -//!# async fn search(client: &Qdrant) +//!# async fn query(client: &Qdrant) //!# -> Result<(), QdrantError> { -//! let search_request = SearchPointsBuilder::new( -//! "my_collection", // Collection name -//! vec![0.0_f32; 512], // Search vector -//! 4, // Search limit, number of results to return -//! ).with_payload(true); +//! let query_request = QueryPointsBuilder::new("my_collection") // Collection name +//! .query(vec![0.0_f32; 512]) // Query vector +//! .limit(4) // Search limit, number of results to return +//! .with_payload(true); // Include full payload in the result //! -//! let response = client.search_points(search_request).await?; +//! let response = client.query(query_request).await?; //!# Ok(()) //!# } //! ``` //! -//! The parameter for [`SearchPointsBuilder::new()`](qdrant::SearchPointsBuilder::new) constructor -//! are pretty straightforward: name of the collection, the vector and how many top-k results to -//! return. The [`with_payload(true)`](qdrant::SearchPointsBuilder::with_payload) call tells qdrant -//! to also return the (full) payload data for each point. You can also add a -//! [`filter()`](qdrant::SearchPointsBuilder::filter) call to the -//! [`SearchPointsBuilder`](qdrant::SearchPointsBuilder) to filter the result. See the -//! [`Filter`](qdrant::Filter) documentation for details. +//! The parameter for [`QueryPointsBuilder::new()`](qdrant::QueryPointsBuilder::new) is pretty +//! straightforward: the name of the collection to query in. It is combined with other +//! [functions](qdrant::QueryPointsBuilder#implementations) to further specialize your query to +//! cover all query flavors. //! -//! Documentation: +//! In this example [`query(...)`](qdrant::QueryPointsBuilder::query) is used to enable vector +//! similarity search on the given vector. [`limit(4)`](qdrant::QueryPointsBuilder::limit) +//! specifies we only want up to 4 top-k results. And +//! [`with_payload(true)`](qdrant::QueryPointsBuilder::with_payload) tells Qdrant to also return +//! the (full) payload data for each point. [`filter()`](qdrant::QueryPointsBuilder::filter) is +//! also commonly used to apply payload based filtering. See the [`Filter`](qdrant::Filter) +//! documentation for details. +//! +//! Documentation: #![doc(html_logo_url = "https://qdrant.tech/favicon/android-chrome-192x192.png")] #![doc(issue_tracker_base_url = "https://github.com/qdrant/rust-client/issues/")] From 7a477055f32d2362c73824f415bc036a6dcec5dc Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 23 Jan 2026 10:31:41 +0100 Subject: [PATCH 2/6] Link from search to query API in other places --- src/qdrant_client/mod.rs | 5 ++--- src/qdrant_client/search.rs | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qdrant_client/mod.rs b/src/qdrant_client/mod.rs index bae43ee0..bdbf9f21 100644 --- a/src/qdrant_client/mod.rs +++ b/src/qdrant_client/mod.rs @@ -72,8 +72,7 @@ pub type QdrantBuilder = QdrantConfig; /// - [Collection operations](Self#collection-operations) - manage collections, aliases and cluster configuration /// - [Point operations](Self#point-operations) - manage points and vectors /// - [Payload operations](Self#payload-operations) - manage point payloads -/// - [Search operations](Self#search-operations) - search and explore points -/// - [Query operations](Self#query-operations) - query points using universal search +/// - [Query operations](Self#query-operations) - query (search) points using universal search /// - [Index operations](Self#index-operations) - manage field and payload indices /// - [Snapshot operations](Self#snapshot-operations) - manage instance or collection snapshots /// - [Shard key operations](Self#sharding-key-operations) - manage shard keys @@ -82,7 +81,7 @@ pub type QdrantBuilder = QdrantConfig; /// /// - [`create_collection`](Self::create_collection) - create a new collection /// - [`upsert_points`](Self::upsert_points) - insert or update points -/// - [`search_points`](Self::search_points) - search points with similarity search +/// - [`query_points`](Self::query_points) - query points with similarity search #[derive(Clone)] pub struct Qdrant { /// Client configuration diff --git a/src/qdrant_client/search.rs b/src/qdrant_client/search.rs index a5d587ee..0caf5484 100644 --- a/src/qdrant_client/search.rs +++ b/src/qdrant_client/search.rs @@ -8,6 +8,10 @@ use crate::qdrant_client::{Qdrant, QdrantResult}; /// # Search operations /// +///
+/// For searching, please switch to the more fully featured Query API instead. The search API will be removed in the future. +///
+/// /// Search and explore points. /// /// Documentation: From 8e083f3ae8070d6870356e65031de3025b4edda4 Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 23 Jan 2026 10:36:04 +0100 Subject: [PATCH 3/6] Migrate search example to query --- Cargo.toml | 2 +- README.md | 20 +++++++++++--------- examples/{search.rs => query.rs} | 16 +++++++++------- 3 files changed, 21 insertions(+), 17 deletions(-) rename examples/{search.rs => query.rs} (85%) diff --git a/Cargo.toml b/Cargo.toml index 9edcb13f..843b32ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ generate-snippets = [] uuid = ["dep:uuid"] [[example]] -name = "search" +name = "query" required-features = ["serde"] [[example]] diff --git a/README.md b/README.md index d8eff503..91c832c0 100644 --- a/README.md +++ b/README.md @@ -71,12 +71,12 @@ Add necessary dependencies: cargo add qdrant-client anyhow tonic tokio serde-json --features tokio/rt-multi-thread ``` -Add search example from [`examples/search.rs`](./examples/search.rs) to your `src/main.rs`: +Add query example from [`examples/query.rs`](./examples/query.rs) to your `src/main.rs`: ```rust use qdrant_client::qdrant::{ Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, ScalarQuantizationBuilder, - SearchParamsBuilder, SearchPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, + SearchParamsBuilder, QueryPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, }; use qdrant_client::{Payload, Qdrant, QdrantError}; @@ -127,16 +127,18 @@ async fn main() -> Result<(), QdrantError> { .upsert_points(UpsertPointsBuilder::new(collection_name, points)) .await?; - let search_result = client - .search_points( - SearchPointsBuilder::new(collection_name, [11.; 10], 10) + let query_result = client + .query( + QueryPointsBuilder::new(collection_name) + .query(vec![11.0; 10]) + .limit(10) .filter(Filter::all([Condition::matches("bar", 12)])) .with_payload(true) .params(SearchParamsBuilder::default().exact(true)), ) .await?; - dbg!(&search_result); - // search_result = [ + dbg!(&query_result); + // query_result = [ // { // "id": 0, // "version": 0, @@ -151,10 +153,10 @@ async fn main() -> Result<(), QdrantError> { // } // ] - let found_point = search_result.result.into_iter().next().unwrap(); + let found_point = query_result.result.into_iter().next().unwrap(); let mut payload = found_point.payload; let baz_payload = payload.remove("baz").unwrap().into_json(); - println!("baz: {}", baz_payload); + println!("baz: {baz_payload}"); // baz: {"qux":"quux"} Ok(()) diff --git a/examples/search.rs b/examples/query.rs similarity index 85% rename from examples/search.rs rename to examples/query.rs index da535806..e78815a1 100644 --- a/examples/search.rs +++ b/examples/query.rs @@ -1,6 +1,6 @@ use qdrant_client::qdrant::{ Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, ScalarQuantizationBuilder, - SearchParamsBuilder, SearchPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, + SearchParamsBuilder, QueryPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, }; use qdrant_client::{Payload, Qdrant, QdrantError}; @@ -51,16 +51,18 @@ async fn main() -> Result<(), QdrantError> { .upsert_points(UpsertPointsBuilder::new(collection_name, points)) .await?; - let search_result = client - .search_points( - SearchPointsBuilder::new(collection_name, [11.; 10], 10) + let query_result = client + .query( + QueryPointsBuilder::new(collection_name) + .query(vec![11.0; 10]) + .limit(10) .filter(Filter::all([Condition::matches("bar", 12)])) .with_payload(true) .params(SearchParamsBuilder::default().exact(true)), ) .await?; - dbg!(&search_result); - // search_result = [ + dbg!(&query_result); + // query_result = [ // { // "id": 0, // "version": 0, @@ -75,7 +77,7 @@ async fn main() -> Result<(), QdrantError> { // } // ] - let found_point = search_result.result.into_iter().next().unwrap(); + let found_point = query_result.result.into_iter().next().unwrap(); let mut payload = found_point.payload; let baz_payload = payload.remove("baz").unwrap().into_json(); println!("baz: {baz_payload}"); From c4efda6391c227e0efa61cbb3eca2916689d318b Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 23 Jan 2026 10:39:28 +0100 Subject: [PATCH 4/6] Fix invalid documentation link --- src/qdrant_client/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qdrant_client/mod.rs b/src/qdrant_client/mod.rs index bdbf9f21..9b121d23 100644 --- a/src/qdrant_client/mod.rs +++ b/src/qdrant_client/mod.rs @@ -81,7 +81,7 @@ pub type QdrantBuilder = QdrantConfig; /// /// - [`create_collection`](Self::create_collection) - create a new collection /// - [`upsert_points`](Self::upsert_points) - insert or update points -/// - [`query_points`](Self::query_points) - query points with similarity search +/// - [`query`](Self::query) - query points with similarity search #[derive(Clone)] pub struct Qdrant { /// Client configuration From bb4f3d3931c7ad09e0cac54821d98f5986d5dbaa Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 23 Jan 2026 10:43:09 +0100 Subject: [PATCH 5/6] Reformat --- README.md | 4 ++-- examples/query.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 91c832c0..44274eb8 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ Add query example from [`examples/query.rs`](./examples/query.rs) to your `src/m ```rust use qdrant_client::qdrant::{ - Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, ScalarQuantizationBuilder, - SearchParamsBuilder, QueryPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, + Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, QueryPointsBuilder, + ScalarQuantizationBuilder, SearchParamsBuilder, UpsertPointsBuilder, VectorParamsBuilder, }; use qdrant_client::{Payload, Qdrant, QdrantError}; diff --git a/examples/query.rs b/examples/query.rs index e78815a1..2fb8bbc3 100644 --- a/examples/query.rs +++ b/examples/query.rs @@ -1,6 +1,6 @@ use qdrant_client::qdrant::{ - Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, ScalarQuantizationBuilder, - SearchParamsBuilder, QueryPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder, + Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, QueryPointsBuilder, + ScalarQuantizationBuilder, SearchParamsBuilder, UpsertPointsBuilder, VectorParamsBuilder, }; use qdrant_client::{Payload, Qdrant, QdrantError}; From 5c7afe5f3f7d6a386ca0860c42c9f1073b7cefad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Vis=C3=A9e?= Date: Fri, 23 Jan 2026 11:07:40 +0100 Subject: [PATCH 6/6] Update examples/query.rs Co-authored-by: Kumar Shivendu --- examples/query.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/query.rs b/examples/query.rs index 2fb8bbc3..9b337367 100644 --- a/examples/query.rs +++ b/examples/query.rs @@ -54,7 +54,7 @@ async fn main() -> Result<(), QdrantError> { let query_result = client .query( QueryPointsBuilder::new(collection_name) - .query(vec![11.0; 10]) + .query(vec![1.0; 10]) .limit(10) .filter(Filter::all([Condition::matches("bar", 12)])) .with_payload(true)