Skip to content

Commit 6fc4b9e

Browse files
committed
Fix code samples for multi search
1 parent 085ceb0 commit 6fc4b9e

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.code-samples.meilisearch.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ tenant_token_guide_search_sdk_1: |-
15451545
.unwrap();
15461546
multi_search_1: |-
15471547
let movie = client.index("movie");
1548+
let movie_ratings = client.index("movie_ratings");
1549+
15481550
let search_query_1 = SearchQuery::new(&movie)
15491551
.with_query("pooh")
15501552
.with_limit(5)
@@ -1553,26 +1555,18 @@ multi_search_1: |-
15531555
.with_query("nemo")
15541556
.with_limit(5)
15551557
.build();
1558+
let search_query_3 = SearchQuery::new(&movie_ratings)
1559+
.with_query("us")
1560+
.build();
15561561
1557-
let movie_response = client
1562+
let response = client
15581563
.multi_search()
15591564
.with_search_query(search_query_1)
15601565
.with_search_query(search_query_2)
1561-
.execute::<Movie>()
1566+
.with_search_query(search_query_3)
1567+
.execute::<Document>()
15621568
.await
15631569
.unwrap();
1564-
1565-
let movie_ratings = client.index("movie_ratings");
1566-
let search_query_3 = SearchQuery::new(&movie_ratings)
1567-
.with_query("us")
1568-
.build();
1569-
1570-
let movie_ratings_response = client
1571-
.multi_search()
1572-
.with_search_query(search_query_3)
1573-
.execute::<MovieRatings>()
1574-
.await
1575-
.unwrap();
15761570
get_experimental_features_1: |-
15771571
let client = Client::new("http://localhost:7700", Some("apiKey"));
15781572
let features = ExperimentalFeatures::new(&client);

0 commit comments

Comments
 (0)