|
3 | 3 | # the documentation on build
|
4 | 4 | # You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
|
5 | 5 | ---
|
| 6 | +filtering_guide_nested_1: |- |
| 7 | + let searchParameters = SearchParameters( |
| 8 | + query: "thriller", |
| 9 | + filter: "rating.users >= 90" |
| 10 | + ) |
| 11 | + client.index("movie_ratings").search(searchParameters) { (result: Result<Searchable<Meteorite>, Swift.Error>) in |
| 12 | + switch result { |
| 13 | + case .success(let searchResult): |
| 14 | + print(searchResult) |
| 15 | + case .failure(let error): |
| 16 | + print(error) |
| 17 | + } |
| 18 | + } |
| 19 | +sorting_guide_sort_nested_1: |- |
| 20 | + let searchParameters = SearchParameters( |
| 21 | + query: "science fiction", |
| 22 | + sort: ["rating.users:asc"] |
| 23 | + ) |
| 24 | + client.index("books").search(searchParameters) { (result: Result<Searchable<Meteorite>, Swift.Error>) in |
| 25 | + switch result { |
| 26 | + case .success(let searchResult): |
| 27 | + print(searchResult) |
| 28 | + case .failure(let error): |
| 29 | + print(error) |
| 30 | + } |
| 31 | + } |
6 | 32 | getting_started_faceting: |-
|
7 | 33 | client.index("movies").updateFaceting({ maxValuesPerFacet: 2 })
|
8 | 34 | getting_started_pagination: |-
|
@@ -942,112 +968,6 @@ search_parameter_guide_show_matches_position_1: |-
|
942 | 968 | print(error)
|
943 | 969 | }
|
944 | 970 | }
|
945 |
| -settings_guide_stop_words_1: |- |
946 |
| - let settings = Setting( |
947 |
| - stopWords: [ |
948 |
| - "the", |
949 |
| - "a", |
950 |
| - "an" |
951 |
| - ]) |
952 |
| - client.index("movies").updateSettings(settings) { (result: Result<Searchable<Movie>, Swift.Error>) in |
953 |
| - switch result { |
954 |
| - case .success(let task): |
955 |
| - print(task) |
956 |
| - case .failure(let error): |
957 |
| - print(error) |
958 |
| - } |
959 |
| - } |
960 |
| -settings_guide_ranking_rules_1: |- |
961 |
| - let settings = Setting( |
962 |
| - rankingRules: [ |
963 |
| - "words", |
964 |
| - "typo", |
965 |
| - "proximity", |
966 |
| - "attribute", |
967 |
| - "sort", |
968 |
| - "exactness", |
969 |
| - "release_date:asc", |
970 |
| - "rank:desc" |
971 |
| - ]) |
972 |
| - client.index("movies").updateSettings(settings) { (result) in |
973 |
| - switch result { |
974 |
| - case .success(let task): |
975 |
| - print(task) |
976 |
| - case .failure(let error): |
977 |
| - print(error) |
978 |
| - } |
979 |
| - } |
980 |
| -settings_guide_distinct_1: |- |
981 |
| - let settings = Setting( |
982 |
| - distinctAttribute: "product_id" |
983 |
| - ) |
984 |
| - client.index("jackets").updateSettings(settings) { (result) in |
985 |
| - switch result { |
986 |
| - case .success(let task): |
987 |
| - print(task) |
988 |
| - case .failure(let error): |
989 |
| - print(error) |
990 |
| - } |
991 |
| - } |
992 |
| -settings_guide_searchable_1: |- |
993 |
| - let settings = Setting( |
994 |
| - searchableAttributes: [ |
995 |
| - "title", |
996 |
| - "overview", |
997 |
| - "genres" |
998 |
| - ]) |
999 |
| - client.index("movies").updateSettings(settings) { (result) in |
1000 |
| - switch result { |
1001 |
| - case .success(let task): |
1002 |
| - print(task) |
1003 |
| - case .failure(let error): |
1004 |
| - print(error) |
1005 |
| - } |
1006 |
| - } |
1007 |
| -settings_guide_synonyms_1: |- |
1008 |
| - let settings = Setting( |
1009 |
| - synonyms: [ |
1010 |
| - "sweater": ["jumper"], |
1011 |
| - "jumper": ["sweater"] |
1012 |
| - ]) |
1013 |
| - client.index("tops").updateSettings(settings) { (result) in |
1014 |
| - switch result { |
1015 |
| - case .success(let task): |
1016 |
| - print(task) |
1017 |
| - case .failure(let error): |
1018 |
| - print(error) |
1019 |
| - } |
1020 |
| - } |
1021 |
| -settings_guide_displayed_1: |- |
1022 |
| - let settings = Setting( |
1023 |
| - displayedAttributes: [ |
1024 |
| - "title", |
1025 |
| - "overview", |
1026 |
| - "genres", |
1027 |
| - "release_date" |
1028 |
| - ]) |
1029 |
| - client.index("movies").updateSettings(settings) { (result) in |
1030 |
| - switch result { |
1031 |
| - case .success(let task): |
1032 |
| - print(task) |
1033 |
| - case .failure(let error): |
1034 |
| - print(error) |
1035 |
| - } |
1036 |
| - } |
1037 |
| -settings_guide_sortable_1: |- |
1038 |
| - let settings = Setting( |
1039 |
| - sortableAttributes: [ |
1040 |
| - "author", |
1041 |
| - "price" |
1042 |
| - ]) |
1043 |
| - client.index("books").updateSettings(settings) { (result) in |
1044 |
| - switch result { |
1045 |
| - case .success(let task): |
1046 |
| - print(task) |
1047 |
| - case .failure(let error): |
1048 |
| - print(error) |
1049 |
| - } |
1050 |
| - } |
1051 | 971 | add_movies_json_1: |-
|
1052 | 972 | let path = Bundle.main.url(forResource: "movies", withExtension: "json")!
|
1053 | 973 | let documents: Data = try Data(contentsOf: path)
|
|
0 commit comments