|
| 1 | +get_one_index_1: |- |
| 2 | + client.get_index('movies') |
| 3 | +list_all_indexes_1: |- |
| 4 | + client.get_indexes() |
| 5 | +create_an_index_1: |- |
| 6 | + client.create_index('movies', {'primary_key': 'movie_id'}) |
| 7 | +update_an_index_1: |- |
| 8 | + client.get_index('movies').update(primaryKey='movie_review_id') |
| 9 | +delete_an_index_1: |- |
| 10 | + client.get_index('movies').delete() |
| 11 | +get_one_document_1: |- |
| 12 | + client.get_index('movies').get_document(25684) |
| 13 | +get_documents_1: |- |
| 14 | + client.get_index('movies').get_documents({'limit':2}) |
| 15 | +add_or_replace_documents_1: |- |
| 16 | + client.get_index('movies').add_documents([{ |
| 17 | + 'id': 287947, |
| 18 | + 'title': 'Shazam', |
| 19 | + 'poster': 'https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg', |
| 20 | + 'overview': 'A boy is given the ability to become an adult superhero in times of need with a single magic word.', |
| 21 | + 'release_date': '2019-03-23' |
| 22 | + }]) |
| 23 | +add_or_update_documents_1: |- |
| 24 | + client.get_index('movies').update_documents([{ |
| 25 | + 'id': 287947, |
| 26 | + 'title': 'Shazam12' |
| 27 | + }]) |
| 28 | +delete_all_documents_1: |- |
| 29 | + client.get_index('movies').delete_all_documents() |
| 30 | +delete_one_document_1: |- |
| 31 | + client.get_index('movies').delete_document(25684) |
| 32 | +delete_documents_1: |- |
| 33 | + client.get_index('movies').delete_documents([23488, 153738, 437035, 363869]) |
| 34 | +search_1: |- |
| 35 | + client.get_index('movies').search('American ninja') |
| 36 | +get_update_1: |- |
| 37 | + client.get_index('movies').get_update_status(1) |
| 38 | +get_all_updates_1: |- |
| 39 | + client.get_index('movies').get_all_update_status() |
| 40 | +get_keys_1: |- |
| 41 | + client.get_keys() |
| 42 | +get_settings_1: |- |
| 43 | + client.get_index('movies').get_settings() |
| 44 | +update_settings_1: |- |
| 45 | + client.get_index('movies').update_settings({ |
| 46 | + 'rankingRules': [ |
| 47 | + 'typo', |
| 48 | + 'words', |
| 49 | + 'proximity', |
| 50 | + 'attribute', |
| 51 | + 'wordsPosition', |
| 52 | + 'exactness', |
| 53 | + 'desc(release_date)', |
| 54 | + 'desc(rank)' |
| 55 | + ], |
| 56 | + 'distinctAttribute': 'movie_id', |
| 57 | + 'searchableAttributes': [ |
| 58 | + 'uid', |
| 59 | + 'movie_id', |
| 60 | + 'title', |
| 61 | + 'description', |
| 62 | + 'poster', |
| 63 | + 'release_date', |
| 64 | + 'rank' |
| 65 | + ], |
| 66 | + 'displayedAttributes': [ |
| 67 | + 'title', |
| 68 | + 'description', |
| 69 | + 'poster', |
| 70 | + 'release_date', |
| 71 | + 'rank' |
| 72 | + ], |
| 73 | + 'stopWords': [ |
| 74 | + 'the', |
| 75 | + 'a', |
| 76 | + 'an' |
| 77 | + ], |
| 78 | + 'synonyms': { |
| 79 | + 'wolverine': ['xmen', 'logan'], |
| 80 | + 'logan': ['wolverine'] |
| 81 | + }, |
| 82 | + 'acceptNewFields': False |
| 83 | + }) |
| 84 | +reset_settings_1: |- |
| 85 | + client.get_index('movies').reset_settings() |
| 86 | +get_synonyms_1: |- |
| 87 | + client.get_index('movies').get_synonyms() |
| 88 | +update_synonyms_1: |- |
| 89 | + client.get_index('movies').update_synonyms({ |
| 90 | + 'wolverine': ['xmen', 'logan'], |
| 91 | + 'logan': ['wolverine', 'xmen'], |
| 92 | + 'wow': ['world of warcraft'] |
| 93 | + }) |
| 94 | +reset_synonyms_1: |- |
| 95 | + client.get_index('movies').reset_synonyms() |
| 96 | +get_stop_words_1: |- |
| 97 | + client.get_index('movies').get_stop_words() |
| 98 | +update_stop_words_1: |- |
| 99 | + client.get_index('movies').update_stop_words(['of', 'the', 'to']) |
| 100 | +reset_stop_words_1: |- |
| 101 | + client.get_index('movies').reset_stop_words() |
| 102 | +get_ranking_rules_1: |- |
| 103 | + client.get_index('movies').get_ranking_rules() |
| 104 | +update_ranking_rules_1: |- |
| 105 | + client.get_index('movies').update_ranking_rules([ |
| 106 | + 'typo', |
| 107 | + 'words', |
| 108 | + 'proximity', |
| 109 | + 'attribute', |
| 110 | + 'wordsPosition', |
| 111 | + 'exactness', |
| 112 | + 'asc(release_date)', |
| 113 | + 'desc(rank)' |
| 114 | + ]) |
| 115 | +reset_ranking_rules_1: |- |
| 116 | + client.get_index('movies').reset_ranking_rules() |
| 117 | +get_distinct_attribute_1: |- |
| 118 | + client.get_index('movies').get_distinct_attribute() |
| 119 | +update_distinct_attribute_1: |- |
| 120 | + client.get_index('movies').update_distinct_attribute('movie_id') |
| 121 | +reset_distinct_attribute_1: |- |
| 122 | + client.get_index('movies').reset_distinct_attribute() |
| 123 | +get_searchable_attributes_1: |- |
| 124 | + client.get_index('movies').get_searchable_attributes() |
| 125 | +update_searchable_attributes_1: |- |
| 126 | + client.get_index('movies').update_searchable_attributes([ |
| 127 | + 'title', |
| 128 | + 'description', |
| 129 | + 'uid' |
| 130 | + ]) |
| 131 | +reset_searchable_attributes_1: |- |
| 132 | + client.get_index('movies').reset_searchable_attributes() |
| 133 | +get_displayed_attributes_1: |- |
| 134 | + client.get_index('movies').get_displayed_attributes() |
| 135 | +update_displayed_attributes_1: |- |
| 136 | + client.get_index('movies').update_displayed_attributes([ |
| 137 | + "title", |
| 138 | + 'description', |
| 139 | + 'release_date', |
| 140 | + 'rank', |
| 141 | + 'poster' |
| 142 | + ]) |
| 143 | +reset_displayed_attributes_1: |- |
| 144 | + client.get_index('movies').reset_displayed_attributes() |
| 145 | +get_accept_new_fields_1: |- |
| 146 | + client.get_index('movies').get_accept_new_fields() |
| 147 | +update_accept_new_fields_1: |- |
| 148 | + client.get_index('movies').update_accept_new_fields(False) |
| 149 | +get_index_stats_1: |- |
| 150 | + client.get_index('movies').get_stats() |
| 151 | +get_indexes_stats_1: |- |
| 152 | + client.get_all_stats() |
| 153 | +get_health_1: |- |
| 154 | + client.health() |
| 155 | +update_health_1: |- |
| 156 | + client.update_health() |
| 157 | +get_version_1: |- |
| 158 | + clien.get_version() |
| 159 | +get_pretty_sys_info_1: |- |
| 160 | +get_sys_info_1: |- |
| 161 | + client.get_sys_info() |
| 162 | +distinct_attribute_guide_1: |- |
| 163 | + client.get_index('movies').update_settings({'distinctAttribute': 'product_id'}) |
| 164 | +field_properties_guide_searchable_1: |- |
| 165 | + client.get_index('movies').update_settings({ |
| 166 | + 'searchableAttributes': [ |
| 167 | + 'uid', |
| 168 | + 'movie_id', |
| 169 | + 'title', |
| 170 | + 'description', |
| 171 | + 'poster', |
| 172 | + 'release_date', |
| 173 | + 'rank' |
| 174 | + ]}) |
| 175 | +field_properties_guide_displayed_1: |- |
| 176 | + client.get_index('movies').update_settings({ |
| 177 | + 'displayedAttributes': [ |
| 178 | + 'title', |
| 179 | + 'description', |
| 180 | + 'poster', |
| 181 | + 'release_date', |
| 182 | + 'rank' |
| 183 | + ]}) |
| 184 | +filtering_guide_1: |- |
| 185 | + client.get_index('movies').search('Avengers', { |
| 186 | + 'filters': 'release_date > 795484800' |
| 187 | + }) |
| 188 | +filtering_guide_2: |- |
| 189 | + client.get_index('movies').search('Batman', { |
| 190 | + 'filters': 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")' |
| 191 | + }) |
| 192 | +filtering_guide_3: |- |
| 193 | + client.get_index('movies').search('horror', { |
| 194 | + 'filters': 'director = "Jordan Peele"' |
| 195 | + }) |
| 196 | +filtering_guide_4: |- |
| 197 | + client.get_index('movies').search('Planet of the Apes', { |
| 198 | + 'filters': 'rating >= 3 AND (NOT director = "Tim Burton")' |
| 199 | + }) |
| 200 | +search_parameter_guide_query_1: |- |
| 201 | + client.get_index('movies').search('shifu') |
| 202 | +search_parameter_guide_offset_1: |- |
| 203 | + client.get_index('movies').search('shifu', { |
| 204 | + 'offset': 1 |
| 205 | + }) |
| 206 | +search_parameter_guide_limit_1: |- |
| 207 | + client.get_index('movies').search('shifu', { |
| 208 | + 'limit': 2 |
| 209 | + }) |
| 210 | +search_parameter_guide_retrieve_1: |- |
| 211 | + client.get_index('movies').search('shifu', { |
| 212 | + 'attributesToRetrieve': ['overview', 'title'] |
| 213 | + }) |
| 214 | +search_parameter_guide_crop_1: |- |
| 215 | + client.get_index('movies').search('shifu', { |
| 216 | + 'attributesToCrop': ['overview'], |
| 217 | + 'cropLength': 10 |
| 218 | + }) |
| 219 | +search_parameter_guide_highlight_1: |- |
| 220 | + client.get_index('movies').search('shifu', { |
| 221 | + 'attributesToHighlight': ['overview'] |
| 222 | + }) |
| 223 | +search_parameter_guide_filter_1: |- |
| 224 | + client.get_index('movies').search('n', { |
| 225 | + 'filters': 'title = Nightshift' |
| 226 | + }) |
| 227 | +search_parameter_guide_filter_2: |- |
| 228 | + client.get_index('movies').search('n', { |
| 229 | + 'filters': 'title = "Kung Fu Panda"' |
| 230 | + }) |
| 231 | +search_parameter_guide_matches_1: |- |
| 232 | + client.get_index('movies').search('n', { |
| 233 | + 'filters': 'title = "Kung Fu Panda"', |
| 234 | + 'attributesToHighlight': ['overview'], |
| 235 | + 'matches': 'true' |
| 236 | + }) |
| 237 | +settings_guide_stop_words_1: |- |
| 238 | + client.get_index('movies').update_settings({ |
| 239 | + 'stopWords': [ |
| 240 | + 'the', |
| 241 | + 'a', |
| 242 | + 'an' |
| 243 | + ], |
| 244 | + }) |
| 245 | +settings_guide_ranking_rules_1: |- |
| 246 | + client.get_index('movies').update_settings({ |
| 247 | + 'rankingRules': [ |
| 248 | + 'typo', |
| 249 | + 'words', |
| 250 | + 'proximity', |
| 251 | + 'attribute', |
| 252 | + 'wordsPosition', |
| 253 | + 'exactness', |
| 254 | + 'asc(release_date)', |
| 255 | + 'desc(rank)' |
| 256 | + ] |
| 257 | + }) |
| 258 | +settings_guide_distinct_1: |- |
| 259 | + client.get_index('movies').update_settings({ |
| 260 | + 'distinctAttribute': 'product_id' |
| 261 | + }) |
| 262 | +settings_guide_searchable_1: |- |
| 263 | + client.get_index('movies').update_settings({ |
| 264 | + 'searchableAttributes': [ |
| 265 | + 'uid', |
| 266 | + 'movie_id', |
| 267 | + 'title', |
| 268 | + 'description', |
| 269 | + 'poster', |
| 270 | + 'release_date', |
| 271 | + 'rank' |
| 272 | + ] |
| 273 | + }) |
| 274 | +settings_guide_displayed_1: |- |
| 275 | + client.get_index('movies').update_settings({ |
| 276 | + 'displayedAttributes': [ |
| 277 | + 'title', |
| 278 | + 'description', |
| 279 | + 'poster', |
| 280 | + 'release_date', |
| 281 | + 'rank' |
| 282 | + ] |
| 283 | + }) |
| 284 | +settings_guide_accept_new_fields_1: |- |
| 285 | + client.get_index('movies').update_settings({ |
| 286 | + 'acceptNewFields': False |
| 287 | + }) |
| 288 | +documents_guide_add_movie_1: |- |
| 289 | + client.get_index('movies').add_documents([{ |
| 290 | + 'movie_id': '123sq178', |
| 291 | + 'title': 'Amélie Poulain' |
| 292 | + }]) |
| 293 | +search_guide_1: |- |
| 294 | + client.get_index('movies').search('shifu', { |
| 295 | + 'limit': 5, |
| 296 | + 'offset': 10 |
| 297 | + }) |
| 298 | +search_guide_2: |- |
| 299 | + client.get_index('movies').search('Avengers', { |
| 300 | + 'filters': 'release_date > 795484800' |
| 301 | + }) |
| 302 | +getting_started_create_index_md: |- |
| 303 | + ```bash |
| 304 | + $ pip3 install meilisearch |
| 305 | + ``` |
| 306 | +
|
| 307 | + ```python |
| 308 | + import meilisearch |
| 309 | +
|
| 310 | + client = meilisearch.Client('http://127.0.0.1:7700') |
| 311 | + index = client.create_index(uid='movies') |
| 312 | + ``` |
| 313 | +
|
| 314 | + [About this package](https://github.com/meilisearch/meilisearch-python/) |
| 315 | +getting_started_add_documents_md: |- |
| 316 | + ```python |
| 317 | + import json |
| 318 | +
|
| 319 | + json_file = open('movies.json') |
| 320 | + movies = json.load(json_file) |
| 321 | + index.add_documents(movies) |
| 322 | + ``` |
| 323 | +
|
| 324 | + [About this package](https://github.com/meilisearch/meilisearch-python/) |
| 325 | +getting_started_search_md: |- |
| 326 | + ```python |
| 327 | + index.search('botman') |
| 328 | + ``` |
| 329 | +
|
| 330 | + [About this package](https://github.com/meilisearch/meilisearch-python/) |
0 commit comments