@@ -69,37 +69,37 @@ get_settings_1: |-
69
69
let settings: Settings = movies.get_settings().await.unwrap();
70
70
update_settings_1 : |-
71
71
let mut synonyms = std::collections::HashMap::new();
72
- synonyms.insert(String::from("wolverine"), vec![String::from( "xmen"), String::from( "logan") ]);
73
- synonyms.insert(String::from("logan"), vec![String::from( "wolverine") ]);
72
+ synonyms.insert(String::from("wolverine"), vec!["xmen", "logan"]);
73
+ synonyms.insert(String::from("logan"), vec!["wolverine"]);
74
74
75
75
let settings = Settings::new()
76
- .with_ranking_rules(vec! [
77
- "typo".to_string() ,
78
- "words".to_string() ,
79
- "proximity".to_string() ,
80
- "attribute".to_string() ,
81
- "wordsPosition".to_string() ,
82
- "exactness".to_string() ,
83
- "desc(release_date)".to_string() ,
84
- "desc(rank)".to_string()
85
- ])
86
- .with_distinct_attribute("movie_id".to_string() )
87
- .with_searchable_attributes(vec! [
88
- "title".to_string() ,
89
- "description".to_string() ,
90
- "genre".to_string()
91
- ])
92
- .with_displayed_attributes(vec! [
93
- "title".to_string() ,
94
- "description".to_string() ,
95
- "genre".to_string() ,
96
- "release_date".to_string()
97
- ])
98
- .with_stop_words(vec! [
99
- "the".to_string() ,
100
- "a".to_string() ,
101
- "an".to_string()
102
- ])
76
+ .with_ranking_rules(& [
77
+ "typo",
78
+ "words",
79
+ "proximity",
80
+ "attribute",
81
+ "wordsPosition",
82
+ "exactness",
83
+ "desc(release_date)",
84
+ "desc(rank)"
85
+ ][..] )
86
+ .with_distinct_attribute("movie_id")
87
+ .with_searchable_attributes(& [
88
+ "title",
89
+ "description",
90
+ "genre"
91
+ ][..] )
92
+ .with_displayed_attributes(& [
93
+ "title",
94
+ "description",
95
+ "genre",
96
+ "release_date"
97
+ ][..] )
98
+ .with_stop_words(& [
99
+ "the",
100
+ "a",
101
+ "an"
102
+ ][..] )
103
103
.with_synonyms(synonyms);
104
104
105
105
let progress: Progress = movies.set_settings(&settings).await.unwrap();
@@ -119,14 +119,14 @@ reset_synonyms_1: |-
119
119
get_stop_words_1 : |-
120
120
let stop_words: Vec<String> = movies.get_stop_words().await.unwrap();
121
121
update_stop_words_1 : |-
122
- let stop_words = & ["of", "the", "to"];
123
- let progress: Progress = movies.set_stop_words(stop_words).await.unwrap();
122
+ let stop_words = ["of", "the", "to"];
123
+ let progress: Progress = movies.set_stop_words(& stop_words[..] ).await.unwrap();
124
124
reset_stop_words_1 : |-
125
125
let progress: Progress = movies.reset_stop_words().await.unwrap();
126
126
get_ranking_rules_1 : |-
127
127
let ranking_rules: Vec<String> = movies.get_ranking_rules().await.unwrap();
128
128
update_ranking_rules_1 : |-
129
- let ranking_rules = & [
129
+ let ranking_rules = [
130
130
"typo",
131
131
"words",
132
132
"proximity",
@@ -137,7 +137,7 @@ update_ranking_rules_1: |-
137
137
"desc(rank)",
138
138
];
139
139
140
- let progress: Progress = movies.set_ranking_rules(ranking_rules).await.unwrap();
140
+ let progress: Progress = movies.set_ranking_rules(& ranking_rules[..] ).await.unwrap();
141
141
reset_ranking_rules_1 : |-
142
142
let progress: Progress = movies.reset_ranking_rules().await.unwrap();
143
143
get_distinct_attribute_1 : |-
@@ -149,37 +149,37 @@ reset_distinct_attribute_1: |-
149
149
get_searchable_attributes_1 : |-
150
150
let searchable_attributes: Vec<String> = movies.get_searchable_attributes().await.unwrap();
151
151
update_searchable_attributes_1 : |-
152
- let searchable_attributes = & [
152
+ let searchable_attributes = [
153
153
"title",
154
154
"description",
155
155
"genre"
156
156
];
157
157
158
- let progress: Progress = movies.set_searchable_attributes(searchable_attributes).await.unwrap();
158
+ let progress: Progress = movies.set_searchable_attributes(& searchable_attributes[..] ).await.unwrap();
159
159
reset_searchable_attributes_1 : |-
160
160
let progress: Progress = movies.reset_searchable_attributes().await.unwrap();
161
161
get_attributes_for_faceting_1 : |-
162
162
let attributes_for_faceting: Vec<String> = movies.get_attributes_for_faceting().await.unwrap();
163
163
update_attributes_for_faceting_1 : |-
164
- let attributes_for_faceting = & [
164
+ let attributes_for_faceting = [
165
165
"genres",
166
166
"director"
167
167
];
168
168
169
- let progress: Progress = movies.set_attributes_for_faceting(attributes_for_faceting).await.unwrap();
169
+ let progress: Progress = movies.set_attributes_for_faceting(& attributes_for_faceting[..] ).await.unwrap();
170
170
reset_attributes_for_faceting_1 : |-
171
171
let progress: Progress = movies.reset_attributes_for_faceting().await.unwrap();
172
172
get_displayed_attributes_1 : |-
173
173
let displayed_attributes: Vec<String> = movies.get_displayed_attributes().await.unwrap();
174
174
update_displayed_attributes_1 : |-
175
- let displayed_attributes = & [
175
+ let displayed_attributes = [
176
176
"title",
177
177
"description",
178
178
"genre",
179
179
"release_date"
180
180
];
181
181
182
- let progress: Progress = movies.set_displayed_attributes(displayed_attributes).await.unwrap();
182
+ let progress: Progress = movies.set_displayed_attributes(& displayed_attributes[..] ).await.unwrap();
183
183
reset_displayed_attributes_1 : |-
184
184
let progress: Progress = movies.reset_displayed_attributes().await.unwrap();
185
185
get_index_stats_1 : |-
@@ -195,22 +195,22 @@ distinct_attribute_guide_1: |-
195
195
let jackets: Index = client.get_index("jackets").await.unwrap();
196
196
let progress: Progress = jackets.set_distinct_attribute("product_id").await.unwrap();
197
197
field_properties_guide_searchable_1 : |-
198
- let searchable_attributes = & [
198
+ let searchable_attributes = [
199
199
"title",
200
200
"description",
201
201
"genre"
202
202
];
203
203
204
- let progress: Progress = movies.set_searchable_attributes(searchable_attributes).await.unwrap();
204
+ let progress: Progress = movies.set_searchable_attributes(& searchable_attributes[..] ).await.unwrap();
205
205
field_properties_guide_displayed_1 : |-
206
- let displayed_attributes = & [
206
+ let displayed_attributes = [
207
207
"title",
208
208
"description",
209
209
"genre",
210
210
"release_date"
211
211
];
212
212
213
- let progress: Progress = movies.set_displayed_attributes(displayed_attributes).await.unwrap();
213
+ let progress: Progress = movies.set_displayed_attributes(& displayed_attributes[..] ).await.unwrap();
214
214
filtering_guide_1 : |-
215
215
let results: SearchResults<Movie> = movies.search()
216
216
.with_query("Avengers")
@@ -321,11 +321,11 @@ settings_guide_synonyms_1: |-
321
321
let tops: Index = client.get_index("tops").await.unwrap();
322
322
let progress: Progress = tops.set_synonyms(&synonyms).await.unwrap();
323
323
settings_guide_stop_words_1 : |-
324
- let progress: Progress = movies.set_stop_words(&["the", "a", "an"]).await.unwrap();
324
+ let progress: Progress = movies.set_stop_words(&["the", "a", "an"][..] ).await.unwrap();
325
325
settings_guide_attributes_for_faceting_1 : |-
326
- let progress: Progress = movies.set_attributes_for_faceting(&["director", "genres"]).await.unwrap();
326
+ let progress: Progress = movies.set_attributes_for_faceting(&["director", "genres"][..] ).await.unwrap();
327
327
settings_guide_ranking_rules_1 : |-
328
- let ranking_rules = & [
328
+ let ranking_rules = [
329
329
"typo",
330
330
"words",
331
331
"proximity",
@@ -336,27 +336,27 @@ settings_guide_ranking_rules_1: |-
336
336
"desc(rank)",
337
337
];
338
338
339
- let progress: Progress = movies.set_ranking_rules(ranking_rules).await.unwrap();
339
+ let progress: Progress = movies.set_ranking_rules(& ranking_rules[..] ).await.unwrap();
340
340
settings_guide_distinct_1 : |-
341
341
let jackets: Index = client.get_index("jackets").await.unwrap();
342
342
let progress: Progress = jackets.set_distinct_attribute("product_id").await.unwrap();
343
343
settings_guide_searchable_1 : |-
344
- let searchable_attributes = & [
344
+ let searchable_attributes = [
345
345
"title",
346
346
"description",
347
347
"genre"
348
348
];
349
349
350
- let progress: Progress = movies.set_searchable_attributes(searchable_attributes).await.unwrap();
350
+ let progress: Progress = movies.set_searchable_attributes(& searchable_attributes[..] ).await.unwrap();
351
351
settings_guide_displayed_1 : |-
352
- let displayed_attributes = & [
352
+ let displayed_attributes = [
353
353
"title",
354
354
"description",
355
355
"genre",
356
356
"release_date"
357
357
];
358
358
359
- let progress: Progress = movies.set_displayed_attributes(displayed_attributes).await.unwrap();
359
+ let progress: Progress = movies.set_displayed_attributes(& displayed_attributes[..] ).await.unwrap();
360
360
documents_guide_add_movie_1 : |-
361
361
// Define the type of our documents
362
362
#[derive(Serialize, Deserialize, Debug)]
@@ -500,7 +500,7 @@ getting_started_search_md: |-
500
500
501
501
[About this package](https://github.com/meilisearch/meilisearch-rust/)
502
502
faceted_search_update_settings_1 : |-
503
- let progress: Progress = movies.set_attributes_for_faceting(&["director", "genres"]).await.unwrap();
503
+ let progress: Progress = movies.set_attributes_for_faceting(&["director", "genres"][..] ).await.unwrap();
504
504
faceted_search_facet_filters_1 : |-
505
505
let results: SearchResults<Movie> = movies.search()
506
506
.with_query("thriller")
@@ -517,7 +517,14 @@ faceted_search_facets_distribution_1: |-
517
517
.unwrap();
518
518
let genres: &HashMap<String, usize> = results.facets_distribution.unwrap().get("genres").unwrap();
519
519
faceted_search_walkthrough_attributes_for_faceting_1 : |-
520
- let progress: Progress = movies.set_attributes_for_faceting(&["director", "producer", "genres", "production_companies"]).await.unwrap();
520
+ let attributes_for_faceting = [
521
+ "director",
522
+ "producer",
523
+ "genres",
524
+ "production_companies"
525
+ ];
526
+
527
+ let progress: Progress = movies.set_attributes_for_faceting(&attributes_for_faceting[..]).await.unwrap();
521
528
faceted_search_walkthrough_facet_filters_1 : |-
522
529
let results: SearchResults<Movie> = movies.search()
523
530
.with_query("thriller")
0 commit comments