|
86 | 86 | //! |
87 | 87 | //! Documentation: <https://qdrant.tech/documentation/concepts/points/#upload-points> |
88 | 88 | //! |
89 | | -//! # Search |
| 89 | +//! # Query (search) |
90 | 90 | //! |
91 | 91 | //! Finally, we can retrieve points in various ways, the common one being a plain similarity |
92 | 92 | //! search: |
93 | 93 | //! |
94 | 94 | //! ```no_run |
95 | 95 | //!# use qdrant_client::{Qdrant, QdrantError}; |
96 | | -//! use qdrant_client::qdrant::SearchPointsBuilder; |
| 96 | +//! use qdrant_client::qdrant::QueryPointsBuilder; |
97 | 97 | //! |
98 | | -//!# async fn search(client: &Qdrant) |
| 98 | +//!# async fn query(client: &Qdrant) |
99 | 99 | //!# -> Result<(), QdrantError> { |
100 | | -//! let search_request = SearchPointsBuilder::new( |
101 | | -//! "my_collection", // Collection name |
102 | | -//! vec![0.0_f32; 512], // Search vector |
103 | | -//! 4, // Search limit, number of results to return |
104 | | -//! ).with_payload(true); |
| 100 | +//! let query_request = QueryPointsBuilder::new("my_collection") // Collection name |
| 101 | +//! .query(vec![0.0_f32; 512]) // Query vector |
| 102 | +//! .limit(4) // Search limit, number of results to return |
| 103 | +//! .with_payload(true); // Include full payload in the result |
105 | 104 | //! |
106 | | -//! let response = client.search_points(search_request).await?; |
| 105 | +//! let response = client.query(query_request).await?; |
107 | 106 | //!# Ok(()) |
108 | 107 | //!# } |
109 | 108 | //! ``` |
110 | 109 | //! |
111 | | -//! The parameter for [`SearchPointsBuilder::new()`](qdrant::SearchPointsBuilder::new) constructor |
112 | | -//! are pretty straightforward: name of the collection, the vector and how many top-k results to |
113 | | -//! return. The [`with_payload(true)`](qdrant::SearchPointsBuilder::with_payload) call tells qdrant |
114 | | -//! to also return the (full) payload data for each point. You can also add a |
115 | | -//! [`filter()`](qdrant::SearchPointsBuilder::filter) call to the |
116 | | -//! [`SearchPointsBuilder`](qdrant::SearchPointsBuilder) to filter the result. See the |
117 | | -//! [`Filter`](qdrant::Filter) documentation for details. |
| 110 | +//! The parameter for [`QueryPointsBuilder::new()`](qdrant::QueryPointsBuilder::new) is pretty |
| 111 | +//! straightforward: the name of the collection to query in. It is combined with other |
| 112 | +//! [functions](qdrant::QueryPointsBuilder#implementations) to further specialize your query to |
| 113 | +//! cover all query flavors. |
118 | 114 | //! |
119 | | -//! Documentation: <https://qdrant.tech/documentation/concepts/search/> |
| 115 | +//! In this example [`query(...)`](qdrant::QueryPointsBuilder::query) is used to enable vector |
| 116 | +//! similarity search on the given vector. [`limit(4)`](qdrant::QueryPointsBuilder::limit) |
| 117 | +//! specifies we only want up to 4 top-k results. And |
| 118 | +//! [`with_payload(true)`](qdrant::QueryPointsBuilder::with_payload) tells Qdrant to also return |
| 119 | +//! the (full) payload data for each point. [`filter()`](qdrant::QueryPointsBuilder::filter) is |
| 120 | +//! also commonly used to apply payload based filtering. See the [`Filter`](qdrant::Filter) |
| 121 | +//! documentation for details. |
| 122 | +//! |
| 123 | +//! Documentation: <https://qdrant.tech/documentation/concepts/search/#query-api> |
120 | 124 |
|
121 | 125 | #![doc(html_logo_url = "https://qdrant.tech/favicon/android-chrome-192x192.png")] |
122 | 126 | #![doc(issue_tracker_base_url = "https://github.com/qdrant/rust-client/issues/")] |
|
0 commit comments