@@ -71,12 +71,12 @@ Add necessary dependencies:
7171cargo add qdrant-client anyhow tonic tokio serde-json --features tokio/rt-multi-thread
7272```
7373
74- Add search example from [ ` examples/search .rs ` ] ( ./examples/search .rs ) to your ` src/main.rs ` :
74+ Add query example from [ ` examples/query .rs ` ] ( ./examples/query .rs ) to your ` src/main.rs ` :
7575
7676``` rust
7777use qdrant_client :: qdrant :: {
7878 Condition , CreateCollectionBuilder , Distance , Filter , PointStruct , ScalarQuantizationBuilder ,
79- SearchParamsBuilder , SearchPointsBuilder , UpsertPointsBuilder , VectorParamsBuilder ,
79+ SearchParamsBuilder , QueryPointsBuilder , UpsertPointsBuilder , VectorParamsBuilder ,
8080};
8181use qdrant_client :: {Payload , Qdrant , QdrantError };
8282
@@ -127,16 +127,18 @@ async fn main() -> Result<(), QdrantError> {
127127 . upsert_points (UpsertPointsBuilder :: new (collection_name , points ))
128128 . await ? ;
129129
130- let search_result = client
131- . search_points (
132- SearchPointsBuilder :: new (collection_name , [11 . ; 10 ], 10 )
130+ let query_result = client
131+ . query (
132+ QueryPointsBuilder :: new (collection_name )
133+ . query (vec! [11.0 ; 10 ])
134+ . limit (10 )
133135 . filter (Filter :: all ([Condition :: matches (" bar" , 12 )]))
134136 . with_payload (true )
135137 . params (SearchParamsBuilder :: default (). exact (true )),
136138 )
137139 . await ? ;
138- dbg! (& search_result );
139- // search_result = [
140+ dbg! (& query_result );
141+ // query_result = [
140142 // {
141143 // "id": 0,
142144 // "version": 0,
@@ -151,10 +153,10 @@ async fn main() -> Result<(), QdrantError> {
151153 // }
152154 // ]
153155
154- let found_point = search_result . result. into_iter (). next (). unwrap ();
156+ let found_point = query_result . result. into_iter (). next (). unwrap ();
155157 let mut payload = found_point . payload;
156158 let baz_payload = payload . remove (" baz" ). unwrap (). into_json ();
157- println! (" baz: {} " , baz_payload );
159+ println! (" baz: {baz_payload} " );
158160 // baz: {"qux":"quux"}
159161
160162 Ok (())
0 commit comments