Skip to content

Commit 677539c

Browse files
bors[bot]meili-bot
andauthored
Merge #438
438: Update code-samples request from Feb/23 r=bidoubiwa a=meili-bot _This PR is auto-generated._ Update the code-samples.meilisearch.yml according to the [integration-guides issue](meilisearch/integration-guides#246) for more information and the complete description about what should be done here check that issue. Co-authored-by: meili-bot <[email protected]>
2 parents 9787c57 + d0eba00 commit 677539c

File tree

1 file changed

+18
-112
lines changed

1 file changed

+18
-112
lines changed

.code-samples.meilisearch.yaml

Lines changed: 18 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,15 @@ filtering_guide_3: |-
605605
.execute()
606606
.await
607607
.unwrap();
608+
filtering_guide_nested_1: |-
609+
let results: SearchResults<MovieRatings> = client
610+
.index("movie_rating")
611+
.search()
612+
.with_query("thriller")
613+
.with_filter("rating.users >= 90")
614+
.execute()
615+
.await
616+
.unwrap();
608617
search_parameter_guide_query_1: |-
609618
let results: SearchResults<Movie> = client
610619
.index("movies")
@@ -746,125 +755,13 @@ search_parameter_guide_hitsperpage_1: |-
746755
client.index("movies").search().with_hits_per_page(15).execute().await?;
747756
search_parameter_guide_page_1: |-
748757
client.index("movies").search().with_page(2).execute().await?;
749-
settings_guide_synonyms_1: |-
750-
let mut synonyms = HashMap::new();
751-
synonyms.insert(String::from("sweater"), vec![String::from("jumper")]);
752-
synonyms.insert(String::from("jumper"), vec![String::from("sweater")]);
753-
754-
let settings = Settings::new()
755-
.with_synonyms(synonyms);
756-
757-
let task = client
758-
.index("tops")
759-
.set_settings(&settings)
760-
.await
761-
.unwrap();
762-
settings_guide_stop_words_1: |-
763-
let settings = Settings::new()
764-
.with_stop_words([
765-
"the",
766-
"a",
767-
"an"
768-
]);
769-
770-
let task: TaskInfo = client
771-
.index("movies")
772-
.set_settings(&settings)
773-
.await
774-
.unwrap();
775758
settings_guide_filterable_attributes_1: |-
776759
let settings = Settings::new()
777760
.with_filterable_attributes([
778761
"director",
779762
"genres"
780763
]);
781764
782-
let task: TaskInfo = client
783-
.index("movies")
784-
.set_settings(&settings)
785-
.await
786-
.unwrap();
787-
settings_guide_ranking_rules_1: |-
788-
let settings = Settings::new()
789-
.with_ranking_rules([
790-
"words",
791-
"typo",
792-
"proximity",
793-
"attribute",
794-
"sort",
795-
"exactness",
796-
"release_date:asc",
797-
"rank:desc",
798-
]);
799-
800-
let task: TaskInfo = client
801-
.index("movies")
802-
.set_settings(&settings)
803-
.await
804-
.unwrap();
805-
settings_guide_distinct_1: |-
806-
let settings = Settings::new()
807-
.with_distinct_attribute("product_id");
808-
809-
let task: TaskInfo = client
810-
.index("jackets")
811-
.set_settings(&settings)
812-
.await
813-
.unwrap();
814-
settings_guide_searchable_1: |-
815-
let settings = Settings::new()
816-
.with_searchable_attributes([
817-
"title",
818-
"overview",
819-
"genres"
820-
]);
821-
822-
let task: TaskInfo = client
823-
.index("movies")
824-
.set_settings(&settings)
825-
.await
826-
.unwrap();
827-
settings_guide_pagination_1: |-
828-
let pagination = PaginationSetting {max_total_hits:100};
829-
830-
let task: TaskInfo = client
831-
.index("movies")
832-
.set_pagination(pagination)
833-
.await
834-
.unwrap();
835-
settings_guide_displayed_1: |-
836-
let settings = Settings::new()
837-
.with_displayed_attributes([
838-
"title",
839-
"overview",
840-
"genres",
841-
"release_date"
842-
]);
843-
844-
let task: TaskInfo = client
845-
.index("movies")
846-
.set_settings(&settings)
847-
.await
848-
.unwrap();
849-
settings_guide_sortable_1: |-
850-
let settings = Settings::new()
851-
.with_sortable_attributes([
852-
"author",
853-
"price"
854-
]);
855-
856-
let task: TaskInfo = client
857-
.index("books")
858-
.set_settings(&settings)
859-
.await
860-
.unwrap();
861-
settings_guide_faceting_1: |-
862-
let faceting = FacetingSettings {
863-
max_values_per_facet: 5,
864-
};
865-
let settings = Settings::new()
866-
.with_faceting(&faceting);
867-
868765
let task: TaskInfo = client
869766
.index("movies")
870767
.set_settings(&settings)
@@ -1316,6 +1213,15 @@ sorting_guide_sort_parameter_2: |-
13161213
.execute()
13171214
.await
13181215
.unwrap();
1216+
sorting_guide_sort_nested_1: |-
1217+
let results: SearchResults<Books> = client
1218+
.index("books")
1219+
.search()
1220+
.with_query("science fiction")
1221+
.with_sort(&["rating.users:asc"])
1222+
.execute()
1223+
.await
1224+
.unwrap();
13191225
get_sortable_attributes_1: |-
13201226
let sortable_attributes: Vec<String> = client
13211227
.index("books")

0 commit comments

Comments
 (0)