meilisearch-python-sdk 3.4.0__py3-none-any.whl → 3.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of meilisearch-python-sdk might be problematic. Click here for more details.

@@ -123,7 +123,6 @@ class AsyncIndex(_BaseIndex):
123
123
  """Class initializer.
124
124
 
125
125
  Args:
126
-
127
126
  http_client: An instance of the AsyncClient. This automatically gets passed by the
128
127
  AsyncClient when creating and AsyncIndex instance.
129
128
  uid: The index's unique identifier.
@@ -155,10 +154,9 @@ class AsyncIndex(_BaseIndex):
155
154
  if not self.plugins or not self.plugins.add_documents_plugins:
156
155
  return None
157
156
 
158
- plugins = []
159
- for plugin in self.plugins.add_documents_plugins:
160
- if plugin.CONCURRENT_EVENT:
161
- plugins.append(plugin)
157
+ plugins = [
158
+ plugin for plugin in self.plugins.add_documents_plugins if plugin.CONCURRENT_EVENT
159
+ ]
162
160
 
163
161
  if not plugins:
164
162
  return None
@@ -170,10 +168,7 @@ class AsyncIndex(_BaseIndex):
170
168
  if not self.plugins or not self.plugins.add_documents_plugins:
171
169
  return None
172
170
 
173
- plugins = []
174
- for plugin in self.plugins.add_documents_plugins:
175
- if plugin.POST_EVENT:
176
- plugins.append(plugin)
171
+ plugins = [plugin for plugin in self.plugins.add_documents_plugins if plugin.POST_EVENT]
177
172
 
178
173
  if not plugins:
179
174
  return None
@@ -185,10 +180,7 @@ class AsyncIndex(_BaseIndex):
185
180
  if not self.plugins or not self.plugins.add_documents_plugins:
186
181
  return None
187
182
 
188
- plugins = []
189
- for plugin in self.plugins.add_documents_plugins:
190
- if plugin.PRE_EVENT:
191
- plugins.append(plugin)
183
+ plugins = [plugin for plugin in self.plugins.add_documents_plugins if plugin.PRE_EVENT]
192
184
 
193
185
  if not plugins:
194
186
  return None
@@ -200,10 +192,11 @@ class AsyncIndex(_BaseIndex):
200
192
  if not self.plugins or not self.plugins.delete_all_documents_plugins:
201
193
  return None
202
194
 
203
- plugins = []
204
- for plugin in self.plugins.delete_all_documents_plugins:
205
- if plugin.CONCURRENT_EVENT:
206
- plugins.append(plugin)
195
+ plugins = [
196
+ plugin
197
+ for plugin in self.plugins.delete_all_documents_plugins
198
+ if plugin.CONCURRENT_EVENT
199
+ ]
207
200
 
208
201
  if not plugins:
209
202
  return None
@@ -215,10 +208,9 @@ class AsyncIndex(_BaseIndex):
215
208
  if not self.plugins or not self.plugins.delete_all_documents_plugins:
216
209
  return None
217
210
 
218
- plugins = []
219
- for plugin in self.plugins.delete_all_documents_plugins:
220
- if plugin.POST_EVENT:
221
- plugins.append(plugin)
211
+ plugins = [
212
+ plugin for plugin in self.plugins.delete_all_documents_plugins if plugin.POST_EVENT
213
+ ]
222
214
 
223
215
  if not plugins:
224
216
  return None
@@ -230,10 +222,9 @@ class AsyncIndex(_BaseIndex):
230
222
  if not self.plugins or not self.plugins.delete_all_documents_plugins:
231
223
  return None
232
224
 
233
- plugins = []
234
- for plugin in self.plugins.delete_all_documents_plugins:
235
- if plugin.PRE_EVENT:
236
- plugins.append(plugin)
225
+ plugins = [
226
+ plugin for plugin in self.plugins.delete_all_documents_plugins if plugin.PRE_EVENT
227
+ ]
237
228
 
238
229
  if not plugins:
239
230
  return None
@@ -245,10 +236,9 @@ class AsyncIndex(_BaseIndex):
245
236
  if not self.plugins or not self.plugins.delete_document_plugins:
246
237
  return None
247
238
 
248
- plugins = []
249
- for plugin in self.plugins.delete_document_plugins:
250
- if plugin.CONCURRENT_EVENT:
251
- plugins.append(plugin)
239
+ plugins = [
240
+ plugin for plugin in self.plugins.delete_document_plugins if plugin.CONCURRENT_EVENT
241
+ ]
252
242
 
253
243
  if not plugins:
254
244
  return None
@@ -260,10 +250,7 @@ class AsyncIndex(_BaseIndex):
260
250
  if not self.plugins or not self.plugins.delete_document_plugins:
261
251
  return None
262
252
 
263
- plugins = []
264
- for plugin in self.plugins.delete_document_plugins:
265
- if plugin.POST_EVENT:
266
- plugins.append(plugin)
253
+ plugins = [plugin for plugin in self.plugins.delete_document_plugins if plugin.POST_EVENT]
267
254
 
268
255
  if not plugins:
269
256
  return None
@@ -275,10 +262,7 @@ class AsyncIndex(_BaseIndex):
275
262
  if not self.plugins or not self.plugins.delete_document_plugins:
276
263
  return None
277
264
 
278
- plugins = []
279
- for plugin in self.plugins.delete_document_plugins:
280
- if plugin.PRE_EVENT:
281
- plugins.append(plugin)
265
+ plugins = [plugin for plugin in self.plugins.delete_document_plugins if plugin.PRE_EVENT]
282
266
 
283
267
  if not plugins:
284
268
  return None
@@ -290,10 +274,9 @@ class AsyncIndex(_BaseIndex):
290
274
  if not self.plugins or not self.plugins.delete_documents_plugins:
291
275
  return None
292
276
 
293
- plugins = []
294
- for plugin in self.plugins.delete_documents_plugins:
295
- if plugin.CONCURRENT_EVENT:
296
- plugins.append(plugin)
277
+ plugins = [
278
+ plugin for plugin in self.plugins.delete_documents_plugins if plugin.CONCURRENT_EVENT
279
+ ]
297
280
 
298
281
  if not plugins:
299
282
  return None
@@ -305,10 +288,7 @@ class AsyncIndex(_BaseIndex):
305
288
  if not self.plugins or not self.plugins.delete_documents_plugins:
306
289
  return None
307
290
 
308
- plugins = []
309
- for plugin in self.plugins.delete_documents_plugins:
310
- if plugin.POST_EVENT:
311
- plugins.append(plugin)
291
+ plugins = [plugin for plugin in self.plugins.delete_documents_plugins if plugin.POST_EVENT]
312
292
 
313
293
  if not plugins:
314
294
  return None
@@ -320,10 +300,7 @@ class AsyncIndex(_BaseIndex):
320
300
  if not self.plugins or not self.plugins.delete_documents_plugins:
321
301
  return None
322
302
 
323
- plugins = []
324
- for plugin in self.plugins.delete_documents_plugins:
325
- if plugin.PRE_EVENT:
326
- plugins.append(plugin)
303
+ plugins = [plugin for plugin in self.plugins.delete_documents_plugins if plugin.PRE_EVENT]
327
304
 
328
305
  if not plugins:
329
306
  return None
@@ -335,10 +312,11 @@ class AsyncIndex(_BaseIndex):
335
312
  if not self.plugins or not self.plugins.delete_documents_by_filter_plugins:
336
313
  return None
337
314
 
338
- plugins = []
339
- for plugin in self.plugins.delete_documents_by_filter_plugins:
340
- if plugin.CONCURRENT_EVENT:
341
- plugins.append(plugin)
315
+ plugins = [
316
+ plugin
317
+ for plugin in self.plugins.delete_documents_by_filter_plugins
318
+ if plugin.CONCURRENT_EVENT
319
+ ]
342
320
 
343
321
  if not plugins:
344
322
  return None
@@ -350,10 +328,11 @@ class AsyncIndex(_BaseIndex):
350
328
  if not self.plugins or not self.plugins.delete_documents_by_filter_plugins:
351
329
  return None
352
330
 
353
- plugins = []
354
- for plugin in self.plugins.delete_documents_by_filter_plugins:
355
- if plugin.POST_EVENT:
356
- plugins.append(plugin)
331
+ plugins = [
332
+ plugin
333
+ for plugin in self.plugins.delete_documents_by_filter_plugins
334
+ if plugin.POST_EVENT
335
+ ]
357
336
 
358
337
  if not plugins:
359
338
  return None
@@ -365,10 +344,9 @@ class AsyncIndex(_BaseIndex):
365
344
  if not self.plugins or not self.plugins.delete_documents_by_filter_plugins:
366
345
  return None
367
346
 
368
- plugins = []
369
- for plugin in self.plugins.delete_documents_by_filter_plugins:
370
- if plugin.PRE_EVENT:
371
- plugins.append(plugin)
347
+ plugins = [
348
+ plugin for plugin in self.plugins.delete_documents_by_filter_plugins if plugin.PRE_EVENT
349
+ ]
372
350
 
373
351
  if not plugins:
374
352
  return None
@@ -380,10 +358,9 @@ class AsyncIndex(_BaseIndex):
380
358
  if not self.plugins or not self.plugins.facet_search_plugins:
381
359
  return None
382
360
 
383
- plugins = []
384
- for plugin in self.plugins.facet_search_plugins:
385
- if plugin.CONCURRENT_EVENT:
386
- plugins.append(plugin)
361
+ plugins = [
362
+ plugin for plugin in self.plugins.facet_search_plugins if plugin.CONCURRENT_EVENT
363
+ ]
387
364
 
388
365
  if not plugins:
389
366
  return None
@@ -395,10 +372,7 @@ class AsyncIndex(_BaseIndex):
395
372
  if not self.plugins or not self.plugins.facet_search_plugins:
396
373
  return None
397
374
 
398
- plugins = []
399
- for plugin in self.plugins.facet_search_plugins:
400
- if plugin.POST_EVENT:
401
- plugins.append(plugin)
375
+ plugins = [plugin for plugin in self.plugins.facet_search_plugins if plugin.POST_EVENT]
402
376
 
403
377
  if not plugins:
404
378
  return None
@@ -410,10 +384,7 @@ class AsyncIndex(_BaseIndex):
410
384
  if not self.plugins or not self.plugins.facet_search_plugins:
411
385
  return None
412
386
 
413
- plugins = []
414
- for plugin in self.plugins.facet_search_plugins:
415
- if plugin.PRE_EVENT:
416
- plugins.append(plugin)
387
+ plugins = [plugin for plugin in self.plugins.facet_search_plugins if plugin.PRE_EVENT]
417
388
 
418
389
  if not plugins:
419
390
  return None
@@ -425,10 +396,7 @@ class AsyncIndex(_BaseIndex):
425
396
  if not self.plugins or not self.plugins.search_plugins:
426
397
  return None
427
398
 
428
- plugins = []
429
- for plugin in self.plugins.search_plugins:
430
- if plugin.CONCURRENT_EVENT:
431
- plugins.append(plugin)
399
+ plugins = [plugin for plugin in self.plugins.search_plugins if plugin.CONCURRENT_EVENT]
432
400
 
433
401
  if not plugins:
434
402
  return None
@@ -440,10 +408,7 @@ class AsyncIndex(_BaseIndex):
440
408
  if not self.plugins or not self.plugins.search_plugins:
441
409
  return None
442
410
 
443
- plugins = []
444
- for plugin in self.plugins.search_plugins:
445
- if plugin.POST_EVENT:
446
- plugins.append(plugin)
411
+ plugins = [plugin for plugin in self.plugins.search_plugins if plugin.POST_EVENT]
447
412
 
448
413
  if not plugins:
449
414
  return None
@@ -455,10 +420,7 @@ class AsyncIndex(_BaseIndex):
455
420
  if not self.plugins or not self.plugins.search_plugins:
456
421
  return None
457
422
 
458
- plugins = []
459
- for plugin in self.plugins.search_plugins:
460
- if plugin.PRE_EVENT:
461
- plugins.append(plugin)
423
+ plugins = [plugin for plugin in self.plugins.search_plugins if plugin.PRE_EVENT]
462
424
 
463
425
  if not plugins:
464
426
  return None
@@ -472,10 +434,9 @@ class AsyncIndex(_BaseIndex):
472
434
  if not self.plugins or not self.plugins.update_documents_plugins:
473
435
  return None
474
436
 
475
- plugins = []
476
- for plugin in self.plugins.update_documents_plugins:
477
- if plugin.CONCURRENT_EVENT:
478
- plugins.append(plugin)
437
+ plugins = [
438
+ plugin for plugin in self.plugins.update_documents_plugins if plugin.CONCURRENT_EVENT
439
+ ]
479
440
 
480
441
  if not plugins:
481
442
  return None
@@ -487,10 +448,7 @@ class AsyncIndex(_BaseIndex):
487
448
  if not self.plugins or not self.plugins.update_documents_plugins:
488
449
  return None
489
450
 
490
- plugins = []
491
- for plugin in self.plugins.update_documents_plugins:
492
- if plugin.POST_EVENT:
493
- plugins.append(plugin)
451
+ plugins = [plugin for plugin in self.plugins.update_documents_plugins if plugin.POST_EVENT]
494
452
 
495
453
  if not plugins:
496
454
  return None
@@ -502,10 +460,7 @@ class AsyncIndex(_BaseIndex):
502
460
  if not self.plugins or not self.plugins.update_documents_plugins:
503
461
  return None
504
462
 
505
- plugins = []
506
- for plugin in self.plugins.update_documents_plugins:
507
- if plugin.PRE_EVENT:
508
- plugins.append(plugin)
463
+ plugins = [plugin for plugin in self.plugins.update_documents_plugins if plugin.PRE_EVENT]
509
464
 
510
465
  if not plugins:
511
466
  return None
@@ -516,16 +471,13 @@ class AsyncIndex(_BaseIndex):
516
471
  """Deletes the index.
517
472
 
518
473
  Returns:
519
-
520
474
  The details of the task.
521
475
 
522
476
  Raises:
523
-
524
477
  MeilisearchCommunicationError: If there was an error communicating with the server.
525
478
  MeilisearchApiError: If the Meilisearch API returned an error.
526
479
 
527
- Examples:
528
-
480
+ Examples
529
481
  >>> from meilisearch_python_sdk import AsyncClient
530
482
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
531
483
  >>> index = client.index("movies")
@@ -538,16 +490,13 @@ class AsyncIndex(_BaseIndex):
538
490
  """Delete the index if it already exists.
539
491
 
540
492
  Returns:
541
-
542
493
  True if the index was deleted or False if not.
543
494
 
544
495
  Raises:
545
-
546
496
  MeilisearchCommunicationError: If there was an error communicating with the server.
547
497
  MeilisearchApiError: If the Meilisearch API returned an error.
548
498
 
549
- Examples:
550
-
499
+ Examples
551
500
  >>> from meilisearch_python_sdk import AsyncClient
552
501
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
553
502
  >>> index = client.index("movies")
@@ -566,20 +515,16 @@ class AsyncIndex(_BaseIndex):
566
515
  """Update the index primary key.
567
516
 
568
517
  Args:
569
-
570
518
  primary_key: The primary key of the documents.
571
519
 
572
520
  Returns:
573
-
574
521
  An instance of the AsyncIndex with the updated information.
575
522
 
576
523
  Raises:
577
-
578
524
  MeilisearchCommunicationError: If there was an error communicating with the server.
579
525
  MeilisearchApiError: If the Meilisearch API returned an error.
580
526
 
581
- Examples:
582
-
527
+ Examples
583
528
  >>> from meilisearch_python_sdk import AsyncClient
584
529
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
585
530
  >>> index = client.index("movies")
@@ -598,16 +543,13 @@ class AsyncIndex(_BaseIndex):
598
543
  """Gets the infromation about the index.
599
544
 
600
545
  Returns:
601
-
602
546
  An instance of the AsyncIndex containing the retrieved information.
603
547
 
604
548
  Raises:
605
-
606
549
  MeilisearchCommunicationError: If there was an error communicating with the server.
607
550
  MeilisearchApiError: If the Meilisearch API returned an error.
608
551
 
609
- Examples:
610
-
552
+ Examples
611
553
  >>> from meilisearch_python_sdk import AsyncClient
612
554
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
613
555
  >>> index = client.index("movies")
@@ -624,16 +566,13 @@ class AsyncIndex(_BaseIndex):
624
566
  """Get the primary key.
625
567
 
626
568
  Returns:
627
-
628
569
  The primary key for the documents in the index.
629
570
 
630
571
  Raises:
631
-
632
572
  MeilisearchCommunicationError: If there was an error communicating with the server.
633
573
  MeilisearchApiError: If the Meilisearch API returned an error.
634
574
 
635
- Examples:
636
-
575
+ Examples
637
576
  >>> from meilisearch_python_sdk import AsyncClient
638
577
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
639
578
  >>> index = client.index("movies")
@@ -662,7 +601,6 @@ class AsyncIndex(_BaseIndex):
662
601
  through the `Client`.
663
602
 
664
603
  Args:
665
-
666
604
  http_client: An instance of the AsyncClient. This automatically gets passed by the
667
605
  Client when creating an AsyncIndex instance.
668
606
  uid: The index's unique identifier.
@@ -687,16 +625,13 @@ class AsyncIndex(_BaseIndex):
687
625
  JsonDict
688
626
 
689
627
  Returns:
690
-
691
628
  An instance of AsyncIndex containing the information of the newly created index.
692
629
 
693
630
  Raises:
694
-
695
631
  MeilisearchCommunicationError: If there was an error communicating with the server.
696
632
  MeilisearchApiError: If the Meilisearch API returned an error.
697
633
 
698
- Examples:
699
-
634
+ Examples
700
635
  >>> from meilisearch_python_sdk import AsyncClient
701
636
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
702
637
  >>> index = await index.create(client, "movies")
@@ -742,16 +677,13 @@ class AsyncIndex(_BaseIndex):
742
677
  """Get stats of the index.
743
678
 
744
679
  Returns:
745
-
746
680
  Stats of the index.
747
681
 
748
682
  Raises:
749
-
750
683
  MeilisearchCommunicationError: If there was an error communicating with the server.
751
684
  MeilisearchApiError: If the Meilisearch API returned an error.
752
685
 
753
- Examples:
754
-
686
+ Examples
755
687
  >>> from meilisearch_python_sdk import AsyncClient
756
688
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
757
689
  >>> index = client.index("movies")
@@ -793,7 +725,6 @@ class AsyncIndex(_BaseIndex):
793
725
  """Search the index.
794
726
 
795
727
  Args:
796
-
797
728
  query: String containing the word(s) to search
798
729
  offset: Number of documents to skip. Defaults to 0.
799
730
  limit: Maximum number of documents returned. Defaults to 20.
@@ -852,16 +783,13 @@ class AsyncIndex(_BaseIndex):
852
783
  Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
853
784
 
854
785
  Returns:
855
-
856
786
  Results of the search
857
787
 
858
788
  Raises:
859
-
860
789
  MeilisearchCommunicationError: If there was an error communicating with the server.
861
790
  MeilisearchApiError: If the Meilisearch API returned an error.
862
791
 
863
- Examples:
864
-
792
+ Examples
865
793
  >>> from meilisearch_python_sdk import AsyncClient
866
794
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
867
795
  >>> index = client.index("movies")
@@ -1062,7 +990,6 @@ class AsyncIndex(_BaseIndex):
1062
990
  """Search the index.
1063
991
 
1064
992
  Args:
1065
-
1066
993
  query: String containing the word(s) to search
1067
994
  facet_name: The name of the facet to search
1068
995
  facet_query: The facet search value
@@ -1113,16 +1040,13 @@ class AsyncIndex(_BaseIndex):
1113
1040
  Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
1114
1041
 
1115
1042
  Returns:
1116
-
1117
1043
  Results of the search
1118
1044
 
1119
1045
  Raises:
1120
-
1121
1046
  MeilisearchCommunicationError: If there was an error communicating with the server.
1122
1047
  MeilisearchApiError: If the Meilisearch API returned an error.
1123
1048
 
1124
- Examples:
1125
-
1049
+ Examples
1126
1050
  >>> from meilisearch_python_sdk import AsyncClient
1127
1051
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
1128
1052
  >>> index = client.index("movies")
@@ -1324,16 +1248,13 @@ class AsyncIndex(_BaseIndex):
1324
1248
  to None.
1325
1249
 
1326
1250
  Returns:
1327
-
1328
1251
  Results of the search
1329
1252
 
1330
1253
  Raises:
1331
-
1332
1254
  MeilisearchCommunicationError: If there was an error communicating with the server.
1333
1255
  MeilisearchApiError: If the Meilisearch API returned an error.
1334
1256
 
1335
- Examples:
1336
-
1257
+ Examples
1337
1258
  >>> from meilisearch_python_sdk import AsyncClient
1338
1259
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
1339
1260
  >>> index = client.index("movies")
@@ -1365,20 +1286,16 @@ class AsyncIndex(_BaseIndex):
1365
1286
  """Get one document with given document identifier.
1366
1287
 
1367
1288
  Args:
1368
-
1369
1289
  document_id: Unique identifier of the document.
1370
1290
 
1371
1291
  Returns:
1372
-
1373
1292
  The document information
1374
1293
 
1375
1294
  Raises:
1376
-
1377
1295
  MeilisearchCommunicationError: If there was an error communicating with the server.
1378
1296
  MeilisearchApiError: If the Meilisearch API returned an error.
1379
1297
 
1380
- Examples:
1381
-
1298
+ Examples
1382
1299
  >>> from meilisearch_python_sdk import AsyncClient
1383
1300
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
1384
1301
  >>> index = client.index("movies")
@@ -1399,7 +1316,6 @@ class AsyncIndex(_BaseIndex):
1399
1316
  """Get a batch documents from the index.
1400
1317
 
1401
1318
  Args:
1402
-
1403
1319
  offset: Number of documents to skip. Defaults to 0.
1404
1320
  limit: Maximum number of documents returnedd. Defaults to 20.
1405
1321
  fields: Document attributes to show. If this value is None then all
@@ -1408,17 +1324,14 @@ class AsyncIndex(_BaseIndex):
1408
1324
  used with Meilisearch >= v1.2.0
1409
1325
 
1410
1326
  Returns:
1411
-
1412
1327
  Documents info.
1413
1328
 
1414
1329
  Raises:
1415
-
1416
1330
  MeilisearchCommunicationError: If there was an error communicating with the server.
1417
1331
  MeilisearchApiError: If the Meilisearch API returned an error.
1418
1332
 
1419
1333
 
1420
- Examples:
1421
-
1334
+ Examples
1422
1335
  >>> from meilisearch_python_sdk import AsyncClient
1423
1336
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
1424
1337
  >>> index = client.index("movies")
@@ -1457,23 +1370,19 @@ class AsyncIndex(_BaseIndex):
1457
1370
  """Add documents to the index.
1458
1371
 
1459
1372
  Args:
1460
-
1461
1373
  documents: List of documents.
1462
1374
  primary_key: The primary key of the documents. This will be ignored if already set.
1463
1375
  Defaults to None.
1464
1376
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1465
1377
 
1466
1378
  Returns:
1467
-
1468
1379
  The details of the task.
1469
1380
 
1470
1381
  Raises:
1471
-
1472
1382
  MeilisearchCommunicationError: If there was an error communicating with the server.
1473
1383
  MeilisearchApiError: If the Meilisearch API returned an error.
1474
1384
 
1475
- Examples:
1476
-
1385
+ Examples
1477
1386
  >>> from meilisearch_python_sdk import AsyncClient
1478
1387
  >>> documents = [
1479
1388
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -1596,29 +1505,29 @@ class AsyncIndex(_BaseIndex):
1596
1505
  batch_size: int = 1000,
1597
1506
  primary_key: str | None = None,
1598
1507
  compress: bool = False,
1508
+ concurrency_limit: int | None = None,
1599
1509
  ) -> list[TaskInfo]:
1600
1510
  """Adds documents in batches to reduce RAM usage with indexing.
1601
1511
 
1602
1512
  Args:
1603
-
1604
1513
  documents: List of documents.
1605
1514
  batch_size: The number of documents that should be included in each batch.
1606
1515
  Defaults to 1000.
1607
1516
  primary_key: The primary key of the documents. This will be ignored if already set.
1608
1517
  Defaults to None.
1609
1518
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1519
+ concurrency_limit: If set this will limit the number of batches that will be sent
1520
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
1521
+ server with requests. Defaults to None.
1610
1522
 
1611
1523
  Returns:
1612
-
1613
1524
  List of update ids to track the action.
1614
1525
 
1615
1526
  Raises:
1616
-
1617
1527
  MeilisearchCommunicationError: If there was an error communicating with the server.
1618
1528
  MeilisearchApiError: If the Meilisearch API returned an error.
1619
1529
 
1620
- Examples:
1621
-
1530
+ Examples
1622
1531
  >>> from meilisearch_python_sdk import AsyncClient
1623
1532
  >>> >>> documents = [
1624
1533
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -1628,6 +1537,23 @@ class AsyncIndex(_BaseIndex):
1628
1537
  >>> index = client.index("movies")
1629
1538
  >>> await index.add_documents_in_batches(documents)
1630
1539
  """
1540
+ if concurrency_limit:
1541
+ async with asyncio.Semaphore(concurrency_limit):
1542
+ if not use_task_groups():
1543
+ batches = [
1544
+ self.add_documents(x, primary_key, compress=compress)
1545
+ for x in _batch(documents, batch_size)
1546
+ ]
1547
+ return await asyncio.gather(*batches)
1548
+
1549
+ async with asyncio.TaskGroup() as tg: # type: ignore[attr-defined]
1550
+ tasks = [
1551
+ tg.create_task(self.add_documents(x, primary_key, compress=compress))
1552
+ for x in _batch(documents, batch_size)
1553
+ ]
1554
+
1555
+ return [x.result() for x in tasks]
1556
+
1631
1557
  if not use_task_groups():
1632
1558
  batches = [
1633
1559
  self.add_documents(x, primary_key, compress=compress)
@@ -1652,11 +1578,11 @@ class AsyncIndex(_BaseIndex):
1652
1578
  csv_delimiter: str | None = None,
1653
1579
  combine_documents: bool = True,
1654
1580
  compress: bool = False,
1581
+ concurrency_limit: int | None = None,
1655
1582
  ) -> list[TaskInfo]:
1656
1583
  """Load all json files from a directory and add the documents to the index.
1657
1584
 
1658
1585
  Args:
1659
-
1660
1586
  directory_path: Path to the directory that contains the json files.
1661
1587
  primary_key: The primary key of the documents. This will be ignored if already set.
1662
1588
  Defaults to None.
@@ -1668,20 +1594,20 @@ class AsyncIndex(_BaseIndex):
1668
1594
  combine_documents: If set to True this will combine the documents from all the files
1669
1595
  before indexing them. Defaults to True.
1670
1596
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1597
+ concurrency_limit: If set this will limit the number of batches that will be sent
1598
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
1599
+ server with requests. Defaults to None.
1671
1600
 
1672
1601
  Returns:
1673
-
1674
1602
  The details of the task status.
1675
1603
 
1676
1604
  Raises:
1677
-
1678
1605
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
1679
1606
  MeilisearchError: If the file path is not valid
1680
1607
  MeilisearchCommunicationError: If there was an error communicating with the server.
1681
1608
  MeilisearchApiError: If the Meilisearch API returned an error.
1682
1609
 
1683
- Examples:
1684
-
1610
+ Examples
1685
1611
  >>> from pathlib import Path
1686
1612
  >>> from meilisearch_python_sdk import AsyncClient
1687
1613
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -1709,6 +1635,54 @@ class AsyncIndex(_BaseIndex):
1709
1635
 
1710
1636
  return [response]
1711
1637
 
1638
+ if concurrency_limit:
1639
+ async with asyncio.Semaphore(concurrency_limit):
1640
+ if not use_task_groups():
1641
+ add_documents = []
1642
+ for path in directory.iterdir():
1643
+ if path.suffix == f".{document_type}":
1644
+ documents = await _async_load_documents_from_file(
1645
+ path, csv_delimiter, json_handler=self._json_handler
1646
+ )
1647
+ add_documents.append(
1648
+ self.add_documents(documents, primary_key, compress=compress)
1649
+ )
1650
+
1651
+ _raise_on_no_documents(add_documents, document_type, directory_path)
1652
+
1653
+ if len(add_documents) > 1:
1654
+ # Send the first document on its own before starting the gather. Otherwise Meilisearch
1655
+ # returns an error because it thinks all entries are trying to create the same index.
1656
+ first_response = [await add_documents.pop()]
1657
+
1658
+ responses = await asyncio.gather(*add_documents)
1659
+ responses = [*first_response, *responses]
1660
+ else:
1661
+ responses = [await add_documents[0]]
1662
+
1663
+ return responses
1664
+
1665
+ async with asyncio.TaskGroup() as tg: # type: ignore[attr-defined]
1666
+ tasks = []
1667
+ all_results = []
1668
+ for i, path in enumerate(directory.iterdir()):
1669
+ if path.suffix == f".{document_type}":
1670
+ documents = await _async_load_documents_from_file(
1671
+ path, csv_delimiter, json_handler=self._json_handler
1672
+ )
1673
+ if i == 0:
1674
+ all_results = [
1675
+ await self.add_documents(documents, compress=compress)
1676
+ ]
1677
+ else:
1678
+ tasks.append(
1679
+ tg.create_task(
1680
+ self.add_documents(
1681
+ documents, primary_key, compress=compress
1682
+ )
1683
+ )
1684
+ )
1685
+
1712
1686
  if not use_task_groups():
1713
1687
  add_documents = []
1714
1688
  for path in directory.iterdir():
@@ -1766,11 +1740,11 @@ class AsyncIndex(_BaseIndex):
1766
1740
  csv_delimiter: str | None = None,
1767
1741
  combine_documents: bool = True,
1768
1742
  compress: bool = False,
1743
+ concurrency_limit: int | None = None,
1769
1744
  ) -> list[TaskInfo]:
1770
1745
  """Load all json files from a directory and add the documents to the index in batches.
1771
1746
 
1772
1747
  Args:
1773
-
1774
1748
  directory_path: Path to the directory that contains the json files.
1775
1749
  batch_size: The number of documents that should be included in each batch.
1776
1750
  Defaults to 1000.
@@ -1784,20 +1758,20 @@ class AsyncIndex(_BaseIndex):
1784
1758
  combine_documents: If set to True this will combine the documents from all the files
1785
1759
  before indexing them. Defaults to True.
1786
1760
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1761
+ concurrency_limit: If set this will limit the number of batches that will be sent
1762
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
1763
+ server with requests. Defaults to None.
1787
1764
 
1788
1765
  Returns:
1789
-
1790
1766
  List of update ids to track the action.
1791
1767
 
1792
1768
  Raises:
1793
-
1794
1769
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
1795
1770
  MeilisearchError: If the file path is not valid
1796
1771
  MeilisearchCommunicationError: If there was an error communicating with the server.
1797
1772
  MeilisearchApiError: If the Meilisearch API returned an error.
1798
1773
 
1799
- Examples:
1800
-
1774
+ Examples
1801
1775
  >>> from pathlib import Path
1802
1776
  >>> from meilisearch_python_sdk import AsyncClient
1803
1777
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -1826,6 +1800,7 @@ class AsyncIndex(_BaseIndex):
1826
1800
  batch_size=batch_size,
1827
1801
  primary_key=primary_key,
1828
1802
  compress=compress,
1803
+ concurrency_limit=concurrency_limit,
1829
1804
  )
1830
1805
 
1831
1806
  responses: list[TaskInfo] = []
@@ -1842,6 +1817,7 @@ class AsyncIndex(_BaseIndex):
1842
1817
  batch_size=batch_size,
1843
1818
  primary_key=primary_key,
1844
1819
  compress=compress,
1820
+ concurrency_limit=concurrency_limit,
1845
1821
  )
1846
1822
  )
1847
1823
 
@@ -1868,25 +1844,21 @@ class AsyncIndex(_BaseIndex):
1868
1844
  """Add documents to the index from a json file.
1869
1845
 
1870
1846
  Args:
1871
-
1872
1847
  file_path: Path to the json file.
1873
1848
  primary_key: The primary key of the documents. This will be ignored if already set.
1874
1849
  Defaults to None.
1875
1850
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1876
1851
 
1877
1852
  Returns:
1878
-
1879
1853
  The details of the task status.
1880
1854
 
1881
1855
  Raises:
1882
-
1883
1856
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
1884
1857
  MeilisearchError: If the file path is not valid
1885
1858
  MeilisearchCommunicationError: If there was an error communicating with the server.
1886
1859
  MeilisearchApiError: If the Meilisearch API returned an error.
1887
1860
 
1888
- Examples:
1889
-
1861
+ Examples
1890
1862
  >>> from pathlib import Path
1891
1863
  >>> from meilisearch_python_sdk import AsyncClient
1892
1864
  >>> file_path = Path("/path/to/file.json")
@@ -1908,11 +1880,11 @@ class AsyncIndex(_BaseIndex):
1908
1880
  primary_key: str | None = None,
1909
1881
  csv_delimiter: str | None = None,
1910
1882
  compress: bool = False,
1883
+ concurrency_limit: int | None = None,
1911
1884
  ) -> list[TaskInfo]:
1912
1885
  """Adds documents form a json file in batches to reduce RAM usage with indexing.
1913
1886
 
1914
1887
  Args:
1915
-
1916
1888
  file_path: Path to the json file.
1917
1889
  batch_size: The number of documents that should be included in each batch.
1918
1890
  Defaults to 1000.
@@ -1921,20 +1893,20 @@ class AsyncIndex(_BaseIndex):
1921
1893
  csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
1922
1894
  can only be used if the file is a csv file. Defaults to comma.
1923
1895
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1896
+ concurrency_limit: If set this will limit the number of batches that will be sent
1897
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
1898
+ server with requests. Defaults to None.
1924
1899
 
1925
1900
  Returns:
1926
-
1927
1901
  List of update ids to track the action.
1928
1902
 
1929
1903
  Raises:
1930
-
1931
1904
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
1932
1905
  MeilisearchError: If the file path is not valid
1933
1906
  MeilisearchCommunicationError: If there was an error communicating with the server.
1934
1907
  MeilisearchApiError: If the Meilisearch API returned an error.
1935
1908
 
1936
- Examples:
1937
-
1909
+ Examples
1938
1910
  >>> from pathlib import Path
1939
1911
  >>> from meilisearch_python_sdk import AsyncClient
1940
1912
  >>> file_path = Path("/path/to/file.json")
@@ -1951,6 +1923,7 @@ class AsyncIndex(_BaseIndex):
1951
1923
  batch_size=batch_size,
1952
1924
  primary_key=primary_key,
1953
1925
  compress=compress,
1926
+ concurrency_limit=concurrency_limit,
1954
1927
  )
1955
1928
 
1956
1929
  async def add_documents_from_raw_file(
@@ -1967,7 +1940,6 @@ class AsyncIndex(_BaseIndex):
1967
1940
  for batching.
1968
1941
 
1969
1942
  Args:
1970
-
1971
1943
  file_path: The path to the file to send to Meilisearch. Only csv and ndjson files are
1972
1944
  allowed.
1973
1945
  primary_key: The primary key of the documents. This will be ignored if already set.
@@ -1977,19 +1949,16 @@ class AsyncIndex(_BaseIndex):
1977
1949
  compress: If set to True the data will be sent in gzip format. Defaults to False.
1978
1950
 
1979
1951
  Returns:
1980
-
1981
1952
  The details of the task.
1982
1953
 
1983
1954
  Raises:
1984
-
1985
1955
  ValueError: If the file is not a csv or ndjson file, or if a csv_delimiter is sent for
1986
1956
  a non-csv file.
1987
1957
  MeilisearchError: If the file path is not valid
1988
1958
  MeilisearchCommunicationError: If there was an error communicating with the server.
1989
1959
  MeilisearchApiError: If the Meilisearch API returned an error.
1990
1960
 
1991
- Examples:
1992
-
1961
+ Examples
1993
1962
  >>> from pathlib import Path
1994
1963
  >>> from meilisearch_python_sdk import AsyncClient
1995
1964
  >>> file_path = Path("/path/to/file.csv")
@@ -2028,7 +1997,7 @@ class AsyncIndex(_BaseIndex):
2028
1997
  else:
2029
1998
  url = self._documents_url
2030
1999
 
2031
- async with aiofiles.open(upload_path, "r") as f:
2000
+ async with aiofiles.open(upload_path) as f:
2032
2001
  data = await f.read()
2033
2002
 
2034
2003
  response = await self._http_requests.post(
@@ -2047,23 +2016,19 @@ class AsyncIndex(_BaseIndex):
2047
2016
  sending a PATCH request to /experimental-features with { "editDocumentsByFunction": true }.
2048
2017
 
2049
2018
  Args:
2050
-
2051
2019
  function: Rhai function to use to update the documents.
2052
2020
  context: Parameters to use in the function. Defaults to None.
2053
2021
  filter: Filter the documents before applying the function. Defaults to None.
2054
2022
 
2055
2023
  Returns:
2056
-
2057
2024
  The details of the task.
2058
2025
 
2059
2026
  Raises:
2060
-
2061
2027
  MeilisearchError: If the file path is not valid
2062
2028
  MeilisearchCommunicationError: If there was an error communicating with the server.
2063
2029
  MeilisearchApiError: If the Meilisearch API returned an error.
2064
2030
 
2065
- Examples:
2066
-
2031
+ Examples
2067
2032
  >>> from meilisearch_python_sdk import AsyncClient
2068
2033
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2069
2034
  >>> index = client.index("movies")
@@ -2092,23 +2057,19 @@ class AsyncIndex(_BaseIndex):
2092
2057
  """Update documents in the index.
2093
2058
 
2094
2059
  Args:
2095
-
2096
2060
  documents: List of documents.
2097
2061
  primary_key: The primary key of the documents. This will be ignored if already set.
2098
2062
  Defaults to None.
2099
2063
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2100
2064
 
2101
2065
  Returns:
2102
-
2103
2066
  The details of the task.
2104
2067
 
2105
2068
  Raises:
2106
-
2107
2069
  MeilisearchCommunicationError: If there was an error communicating with the server.
2108
2070
  MeilisearchApiError: If the Meilisearch API returned an error.
2109
2071
 
2110
- Examples:
2111
-
2072
+ Examples
2112
2073
  >>> from meilisearch_python_sdk import AsyncClient
2113
2074
  >>> documents = [
2114
2075
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -2232,31 +2193,31 @@ class AsyncIndex(_BaseIndex):
2232
2193
  batch_size: int = 1000,
2233
2194
  primary_key: str | None = None,
2234
2195
  compress: bool = False,
2196
+ concurrency_limit: int | None = None,
2235
2197
  ) -> list[TaskInfo]:
2236
2198
  """Update documents in batches to reduce RAM usage with indexing.
2237
2199
 
2238
2200
  Each batch tries to fill the max_payload_size
2239
2201
 
2240
2202
  Args:
2241
-
2242
2203
  documents: List of documents.
2243
2204
  batch_size: The number of documents that should be included in each batch.
2244
2205
  Defaults to 1000.
2245
2206
  primary_key: The primary key of the documents. This will be ignored if already set.
2246
2207
  Defaults to None.
2247
2208
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2209
+ concurrency_limit: If set this will limit the number of batches that will be sent
2210
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
2211
+ server with requests. Defaults to None.
2248
2212
 
2249
2213
  Returns:
2250
-
2251
2214
  List of update ids to track the action.
2252
2215
 
2253
2216
  Raises:
2254
-
2255
2217
  MeilisearchCommunicationError: If there was an error communicating with the server.
2256
2218
  MeilisearchApiError: If the Meilisearch API returned an error.
2257
2219
 
2258
- Examples:
2259
-
2220
+ Examples
2260
2221
  >>> from meilisearch_python_sdk import AsyncClient
2261
2222
  >>> documents = [
2262
2223
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -2266,6 +2227,22 @@ class AsyncIndex(_BaseIndex):
2266
2227
  >>> index = client.index("movies")
2267
2228
  >>> await index.update_documents_in_batches(documents)
2268
2229
  """
2230
+ if concurrency_limit:
2231
+ async with asyncio.Semaphore(concurrency_limit):
2232
+ if not use_task_groups():
2233
+ batches = [
2234
+ self.update_documents(x, primary_key, compress=compress)
2235
+ for x in _batch(documents, batch_size)
2236
+ ]
2237
+ return await asyncio.gather(*batches)
2238
+
2239
+ async with asyncio.TaskGroup() as tg: # type: ignore[attr-defined]
2240
+ tasks = [
2241
+ tg.create_task(self.update_documents(x, primary_key, compress=compress))
2242
+ for x in _batch(documents, batch_size)
2243
+ ]
2244
+ return [x.result() for x in tasks]
2245
+
2269
2246
  if not use_task_groups():
2270
2247
  batches = [
2271
2248
  self.update_documents(x, primary_key, compress=compress)
@@ -2293,7 +2270,6 @@ class AsyncIndex(_BaseIndex):
2293
2270
  """Load all json files from a directory and update the documents.
2294
2271
 
2295
2272
  Args:
2296
-
2297
2273
  directory_path: Path to the directory that contains the json files.
2298
2274
  primary_key: The primary key of the documents. This will be ignored if already set.
2299
2275
  Defaults to None.
@@ -2307,18 +2283,15 @@ class AsyncIndex(_BaseIndex):
2307
2283
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2308
2284
 
2309
2285
  Returns:
2310
-
2311
2286
  The details of the task status.
2312
2287
 
2313
2288
  Raises:
2314
-
2315
2289
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
2316
2290
  MeilisearchError: If the file path is not valid
2317
2291
  MeilisearchCommunicationError: If there was an error communicating with the server.
2318
2292
  MeilisearchApiError: If the Meilisearch API returned an error.
2319
2293
 
2320
- Examples:
2321
-
2294
+ Examples
2322
2295
  >>> from pathlib import Path
2323
2296
  >>> from meilisearch_python_sdk import AsyncClient
2324
2297
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -2402,11 +2375,11 @@ class AsyncIndex(_BaseIndex):
2402
2375
  csv_delimiter: str | None = None,
2403
2376
  combine_documents: bool = True,
2404
2377
  compress: bool = False,
2378
+ concurrency_limit: int | None = None,
2405
2379
  ) -> list[TaskInfo]:
2406
2380
  """Load all json files from a directory and update the documents.
2407
2381
 
2408
2382
  Args:
2409
-
2410
2383
  directory_path: Path to the directory that contains the json files.
2411
2384
  batch_size: The number of documents that should be included in each batch.
2412
2385
  Defaults to 1000.
@@ -2420,20 +2393,20 @@ class AsyncIndex(_BaseIndex):
2420
2393
  combine_documents: If set to True this will combine the documents from all the files
2421
2394
  before indexing them. Defaults to True.
2422
2395
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2396
+ concurrency_limit: If set this will limit the number of batches that will be sent
2397
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
2398
+ server with requests. Defaults to None.
2423
2399
 
2424
2400
  Returns:
2425
-
2426
2401
  List of update ids to track the action.
2427
2402
 
2428
2403
  Raises:
2429
-
2430
2404
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
2431
2405
  MeilisearchError: If the file path is not valid
2432
2406
  MeilisearchCommunicationError: If there was an error communicating with the server.
2433
2407
  MeilisearchApiError: If the Meilisearch API returned an error.
2434
2408
 
2435
- Examples:
2436
-
2409
+ Examples
2437
2410
  >>> from pathlib import Path
2438
2411
  >>> from meilisearch_python_sdk import AsyncClient
2439
2412
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -2462,6 +2435,7 @@ class AsyncIndex(_BaseIndex):
2462
2435
  batch_size=batch_size,
2463
2436
  primary_key=primary_key,
2464
2437
  compress=compress,
2438
+ concurrency_limit=concurrency_limit,
2465
2439
  )
2466
2440
 
2467
2441
  if not use_task_groups():
@@ -2479,6 +2453,7 @@ class AsyncIndex(_BaseIndex):
2479
2453
  batch_size=batch_size,
2480
2454
  primary_key=primary_key,
2481
2455
  compress=compress,
2456
+ concurrency_limit=concurrency_limit,
2482
2457
  )
2483
2458
  )
2484
2459
 
@@ -2509,6 +2484,7 @@ class AsyncIndex(_BaseIndex):
2509
2484
  batch_size=batch_size,
2510
2485
  primary_key=primary_key,
2511
2486
  compress=compress,
2487
+ concurrency_limit=concurrency_limit,
2512
2488
  )
2513
2489
  else:
2514
2490
  tasks.append(
@@ -2518,6 +2494,7 @@ class AsyncIndex(_BaseIndex):
2518
2494
  batch_size=batch_size,
2519
2495
  primary_key=primary_key,
2520
2496
  compress=compress,
2497
+ concurrency_limit=concurrency_limit,
2521
2498
  )
2522
2499
  )
2523
2500
  )
@@ -2537,7 +2514,6 @@ class AsyncIndex(_BaseIndex):
2537
2514
  """Add documents in the index from a json file.
2538
2515
 
2539
2516
  Args:
2540
-
2541
2517
  file_path: Path to the json file.
2542
2518
  primary_key: The primary key of the documents. This will be ignored if already set.
2543
2519
  Defaults to None.
@@ -2546,16 +2522,13 @@ class AsyncIndex(_BaseIndex):
2546
2522
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2547
2523
 
2548
2524
  Returns:
2549
-
2550
2525
  The details of the task status.
2551
2526
 
2552
2527
  Raises:
2553
-
2554
2528
  MeilisearchCommunicationError: If there was an error communicating with the server.
2555
2529
  MeilisearchApiError: If the Meilisearch API returned an error.
2556
2530
 
2557
- Examples:
2558
-
2531
+ Examples
2559
2532
  >>> from pathlib import Path
2560
2533
  >>> from meilisearch_python_sdk import AsyncClient
2561
2534
  >>> file_path = Path("/path/to/file.json")
@@ -2576,29 +2549,29 @@ class AsyncIndex(_BaseIndex):
2576
2549
  batch_size: int = 1000,
2577
2550
  primary_key: str | None = None,
2578
2551
  compress: bool = False,
2552
+ concurrency_limit: int | None = None,
2579
2553
  ) -> list[TaskInfo]:
2580
2554
  """Updates documents form a json file in batches to reduce RAM usage with indexing.
2581
2555
 
2582
2556
  Args:
2583
-
2584
2557
  file_path: Path to the json file.
2585
2558
  batch_size: The number of documents that should be included in each batch.
2586
2559
  Defaults to 1000.
2587
2560
  primary_key: The primary key of the documents. This will be ignored if already set.
2588
2561
  Defaults to None.
2589
2562
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2563
+ concurrency_limit: If set this will limit the number of batches that will be sent
2564
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
2565
+ server with requests. Defaults to None.
2590
2566
 
2591
2567
  Returns:
2592
-
2593
2568
  List of update ids to track the action.
2594
2569
 
2595
2570
  Raises:
2596
-
2597
2571
  MeilisearchCommunicationError: If there was an error communicating with the server.
2598
2572
  MeilisearchApiError: If the Meilisearch API returned an error.
2599
2573
 
2600
- Examples:
2601
-
2574
+ Examples
2602
2575
  >>> from pathlib import Path
2603
2576
  >>> from meilisearch_python_sdk import AsyncClient
2604
2577
  >>> file_path = Path("/path/to/file.json")
@@ -2615,6 +2588,7 @@ class AsyncIndex(_BaseIndex):
2615
2588
  batch_size=batch_size,
2616
2589
  primary_key=primary_key,
2617
2590
  compress=compress,
2591
+ concurrency_limit=concurrency_limit,
2618
2592
  )
2619
2593
 
2620
2594
  async def update_documents_from_raw_file(
@@ -2631,7 +2605,6 @@ class AsyncIndex(_BaseIndex):
2631
2605
  for batching.
2632
2606
 
2633
2607
  Args:
2634
-
2635
2608
  file_path: The path to the file to send to Meilisearch. Only csv and ndjson files are
2636
2609
  allowed.
2637
2610
  primary_key: The primary key of the documents. This will be ignored if already set.
@@ -2641,19 +2614,16 @@ class AsyncIndex(_BaseIndex):
2641
2614
  compress: If set to True the data will be sent in gzip format. Defaults to False.
2642
2615
 
2643
2616
  Returns:
2644
-
2645
2617
  The details of the task status.
2646
2618
 
2647
2619
  Raises:
2648
-
2649
2620
  ValueError: If the file is not a csv or ndjson file, or if a csv_delimiter is sent for
2650
2621
  a non-csv file.
2651
2622
  MeilisearchError: If the file path is not valid
2652
2623
  MeilisearchCommunicationError: If there was an error communicating with the server.
2653
2624
  MeilisearchApiError: If the Meilisearch API returned an error.
2654
2625
 
2655
- Examples:
2656
-
2626
+ Examples
2657
2627
  >>> from pathlib import Path
2658
2628
  >>> from meilisearch_python_sdk import AsyncClient
2659
2629
  >>> file_path = Path("/path/to/file.csv")
@@ -2692,7 +2662,7 @@ class AsyncIndex(_BaseIndex):
2692
2662
  else:
2693
2663
  url = self._documents_url
2694
2664
 
2695
- async with aiofiles.open(upload_path, "r") as f:
2665
+ async with aiofiles.open(upload_path) as f:
2696
2666
  data = await f.read()
2697
2667
 
2698
2668
  response = await self._http_requests.put(
@@ -2705,20 +2675,16 @@ class AsyncIndex(_BaseIndex):
2705
2675
  """Delete one document from the index.
2706
2676
 
2707
2677
  Args:
2708
-
2709
2678
  document_id: Unique identifier of the document.
2710
2679
 
2711
2680
  Returns:
2712
-
2713
2681
  The details of the task status.
2714
2682
 
2715
2683
  Raises:
2716
-
2717
2684
  MeilisearchCommunicationError: If there was an error communicating with the server.
2718
2685
  MeilisearchApiError: If the Meilisearch API returned an error.
2719
2686
 
2720
- Examples:
2721
-
2687
+ Examples
2722
2688
  >>> from meilisearch_python_sdk import AsyncClient
2723
2689
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2724
2690
  >>> index = client.index("movies")
@@ -2784,20 +2750,16 @@ class AsyncIndex(_BaseIndex):
2784
2750
  """Delete multiple documents from the index.
2785
2751
 
2786
2752
  Args:
2787
-
2788
2753
  ids: List of unique identifiers of documents.
2789
2754
 
2790
2755
  Returns:
2791
-
2792
2756
  List of update ids to track the action.
2793
2757
 
2794
2758
  Raises:
2795
-
2796
2759
  MeilisearchCommunicationError: If there was an error communicating with the server.
2797
2760
  MeilisearchApiError: If the Meilisearch API returned an error.
2798
2761
 
2799
- Examples:
2800
-
2762
+ Examples
2801
2763
  >>> from meilisearch_python_sdk import AsyncClient
2802
2764
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2803
2765
  >>> index = client.index("movies")
@@ -2859,20 +2821,16 @@ class AsyncIndex(_BaseIndex):
2859
2821
  """Delete documents from the index by filter.
2860
2822
 
2861
2823
  Args:
2862
-
2863
2824
  filter: The filter value information.
2864
2825
 
2865
2826
  Returns:
2866
-
2867
2827
  The details of the task status.
2868
2828
 
2869
2829
  Raises:
2870
-
2871
2830
  MeilisearchCommunicationError: If there was an error communicating with the server.
2872
2831
  MeilisearchApiError: If the Meilisearch API returned an error.
2873
2832
 
2874
- Examples:
2875
-
2833
+ Examples
2876
2834
  >>> from meilisearch_pyrhon_sdk import AsyncClient
2877
2835
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2878
2836
  >>> index = client.index("movies")
@@ -2935,25 +2893,24 @@ class AsyncIndex(_BaseIndex):
2935
2893
  return result
2936
2894
 
2937
2895
  async def delete_documents_in_batches_by_filter(
2938
- self, filters: list[str | list[str | list[str]]]
2896
+ self, filters: list[str | list[str | list[str]]], concurrency_limit: int | None = None
2939
2897
  ) -> list[TaskInfo]:
2940
2898
  """Delete batches of documents from the index by filter.
2941
2899
 
2942
2900
  Args:
2943
-
2944
2901
  filters: A list of filter value information.
2902
+ concurrency_limit: If set this will limit the number of batches that will be sent
2903
+ concurrently. This can be helpful if you find you are overloading the Meilisearch
2904
+ server with requests. Defaults to None.
2945
2905
 
2946
2906
  Returns:
2947
-
2948
2907
  The a list of details of the task statuses.
2949
2908
 
2950
2909
  Raises:
2951
-
2952
2910
  MeilisearchCommunicationError: If there was an error communicating with the server.
2953
2911
  MeilisearchApiError: If the Meilisearch API returned an error.
2954
2912
 
2955
- Examples:
2956
-
2913
+ Examples
2957
2914
  >>> from meilisearch_python_sdk import AsyncClient
2958
2915
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2959
2916
  >>> index = client.index("movies")
@@ -2964,6 +2921,20 @@ class AsyncIndex(_BaseIndex):
2964
2921
  >>> ]
2965
2922
  >>> )
2966
2923
  """
2924
+ if concurrency_limit:
2925
+ async with asyncio.Semaphore(concurrency_limit):
2926
+ if not use_task_groups():
2927
+ tasks = [self.delete_documents_by_filter(filter) for filter in filters]
2928
+ return await asyncio.gather(*tasks)
2929
+
2930
+ async with asyncio.TaskGroup() as tg: # type: ignore[attr-defined]
2931
+ tg_tasks = [
2932
+ tg.create_task(self.delete_documents_by_filter(filter))
2933
+ for filter in filters
2934
+ ]
2935
+
2936
+ return [x.result() for x in tg_tasks]
2937
+
2967
2938
  if not use_task_groups():
2968
2939
  tasks = [self.delete_documents_by_filter(filter) for filter in filters]
2969
2940
  return await asyncio.gather(*tasks)
@@ -2979,16 +2950,13 @@ class AsyncIndex(_BaseIndex):
2979
2950
  """Delete all documents from the index.
2980
2951
 
2981
2952
  Returns:
2982
-
2983
2953
  The details of the task status.
2984
2954
 
2985
2955
  Raises:
2986
-
2987
2956
  MeilisearchCommunicationError: If there was an error communicating with the server.
2988
2957
  MeilisearchApiError: If the Meilisearch API returned an error.
2989
2958
 
2990
- Examples:
2991
-
2959
+ Examples
2992
2960
  >>> from meilisearch_python_sdk import AsyncClient
2993
2961
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
2994
2962
  >>> index = client.index("movies")
@@ -3045,16 +3013,13 @@ class AsyncIndex(_BaseIndex):
3045
3013
  """Get settings of the index.
3046
3014
 
3047
3015
  Returns:
3048
-
3049
3016
  Settings of the index.
3050
3017
 
3051
3018
  Raises:
3052
-
3053
3019
  MeilisearchCommunicationError: If there was an error communicating with the server.
3054
3020
  MeilisearchApiError: If the Meilisearch API returned an error.
3055
3021
 
3056
- Examples:
3057
-
3022
+ Examples
3058
3023
  >>> from meilisearch_python_sdk import AsyncClient
3059
3024
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3060
3025
  >>> index = client.index("movies")
@@ -3078,21 +3043,17 @@ class AsyncIndex(_BaseIndex):
3078
3043
  """Update settings of the index.
3079
3044
 
3080
3045
  Args:
3081
-
3082
3046
  body: Settings of the index.
3083
3047
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3084
3048
 
3085
3049
  Returns:
3086
-
3087
3050
  The details of the task status.
3088
3051
 
3089
3052
  Raises:
3090
-
3091
3053
  MeilisearchCommunicationError: If there was an error communicating with the server.
3092
3054
  MeilisearchApiError: If the Meilisearch API returned an error.
3093
3055
 
3094
- Examples:
3095
-
3056
+ Examples
3096
3057
  >>> from meilisearch_python_sdk import AsyncClient
3097
3058
  >>> from meilisearch_python_sdk import MeilisearchSettings
3098
3059
  >>> new_settings = MeilisearchSettings(
@@ -3127,16 +3088,13 @@ class AsyncIndex(_BaseIndex):
3127
3088
  """Reset settings of the index to default values.
3128
3089
 
3129
3090
  Returns:
3130
-
3131
3091
  The details of the task status.
3132
3092
 
3133
3093
  Raises:
3134
-
3135
3094
  MeilisearchCommunicationError: If there was an error communicating with the server.
3136
3095
  MeilisearchApiError: If the Meilisearch API returned an error.
3137
3096
 
3138
- Examples:
3139
-
3097
+ Examples
3140
3098
  >>> from meilisearch_python_sdk import AsyncClient
3141
3099
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3142
3100
  >>> index = client.index("movies")
@@ -3150,16 +3108,13 @@ class AsyncIndex(_BaseIndex):
3150
3108
  """Get ranking rules of the index.
3151
3109
 
3152
3110
  Returns:
3153
-
3154
3111
  List containing the ranking rules of the index.
3155
3112
 
3156
3113
  Raises:
3157
-
3158
3114
  MeilisearchCommunicationError: If there was an error communicating with the server.
3159
3115
  MeilisearchApiError: If the Meilisearch API returned an error.
3160
3116
 
3161
- Examples:
3162
-
3117
+ Examples
3163
3118
  >>> from meilisearch_python_sdk import AsyncClient
3164
3119
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3165
3120
  >>> index = client.index("movies")
@@ -3175,21 +3130,17 @@ class AsyncIndex(_BaseIndex):
3175
3130
  """Update ranking rules of the index.
3176
3131
 
3177
3132
  Args:
3178
-
3179
3133
  ranking_rules: List containing the ranking rules.
3180
3134
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3181
3135
 
3182
3136
  Returns:
3183
-
3184
3137
  The details of the task status.
3185
3138
 
3186
3139
  Raises:
3187
-
3188
3140
  MeilisearchCommunicationError: If there was an error communicating with the server.
3189
3141
  MeilisearchApiError: If the Meilisearch API returned an error.
3190
3142
 
3191
- Examples:
3192
-
3143
+ Examples
3193
3144
  >>> from meilisearch_python_sdk import AsyncClient
3194
3145
  >>> ranking_rules=[
3195
3146
  >>> "words",
@@ -3215,16 +3166,13 @@ class AsyncIndex(_BaseIndex):
3215
3166
  """Reset ranking rules of the index to default values.
3216
3167
 
3217
3168
  Returns:
3218
-
3219
3169
  The details of the task status.
3220
3170
 
3221
3171
  Raises:
3222
-
3223
3172
  MeilisearchCommunicationError: If there was an error communicating with the server.
3224
3173
  MeilisearchApiError: If the Meilisearch API returned an error.
3225
3174
 
3226
- Examples:
3227
-
3175
+ Examples
3228
3176
  >>> from meilisearch_python_sdk import AsyncClient
3229
3177
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3230
3178
  >>> index = client.index("movies")
@@ -3238,17 +3186,14 @@ class AsyncIndex(_BaseIndex):
3238
3186
  """Get distinct attribute of the index.
3239
3187
 
3240
3188
  Returns:
3241
-
3242
3189
  String containing the distinct attribute of the index. If no distinct attribute
3243
3190
  `None` is returned.
3244
3191
 
3245
3192
  Raises:
3246
-
3247
3193
  MeilisearchCommunicationError: If there was an error communicating with the server.
3248
3194
  MeilisearchApiError: If the Meilisearch API returned an error.
3249
3195
 
3250
- Examples:
3251
-
3196
+ Examples
3252
3197
  >>> from meilisearch_python_sdk import AsyncClient
3253
3198
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3254
3199
  >>> index = client.index("movies")
@@ -3265,21 +3210,17 @@ class AsyncIndex(_BaseIndex):
3265
3210
  """Update distinct attribute of the index.
3266
3211
 
3267
3212
  Args:
3268
-
3269
3213
  body: Distinct attribute.
3270
3214
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3271
3215
 
3272
3216
  Returns:
3273
-
3274
3217
  The details of the task status.
3275
3218
 
3276
3219
  Raises:
3277
-
3278
3220
  MeilisearchCommunicationError: If there was an error communicating with the server.
3279
3221
  MeilisearchApiError: If the Meilisearch API returned an error.
3280
3222
 
3281
- Examples:
3282
-
3223
+ Examples
3283
3224
  >>> from meilisearch_python_sdk import AsyncClient
3284
3225
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3285
3226
  >>> index = client.index("movies")
@@ -3295,16 +3236,13 @@ class AsyncIndex(_BaseIndex):
3295
3236
  """Reset distinct attribute of the index to default values.
3296
3237
 
3297
3238
  Returns:
3298
-
3299
3239
  The details of the task status.
3300
3240
 
3301
3241
  Raises:
3302
-
3303
3242
  MeilisearchCommunicationError: If there was an error communicating with the server.
3304
3243
  MeilisearchApiError: If the Meilisearch API returned an error.
3305
3244
 
3306
- Examples:
3307
-
3245
+ Examples
3308
3246
  >>> from meilisearch_python_sdk import AsyncClient
3309
3247
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3310
3248
  >>> index = client.index("movies")
@@ -3318,16 +3256,13 @@ class AsyncIndex(_BaseIndex):
3318
3256
  """Get searchable attributes of the index.
3319
3257
 
3320
3258
  Returns:
3321
-
3322
3259
  List containing the searchable attributes of the index.
3323
3260
 
3324
3261
  Raises:
3325
-
3326
3262
  MeilisearchCommunicationError: If there was an error communicating with the server.
3327
3263
  MeilisearchApiError: If the Meilisearch API returned an error.
3328
3264
 
3329
- Examples:
3330
-
3265
+ Examples
3331
3266
  >>> from meilisearch_python_sdk import AsyncClient
3332
3267
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3333
3268
  >>> index = client.index("movies")
@@ -3343,21 +3278,17 @@ class AsyncIndex(_BaseIndex):
3343
3278
  """Update searchable attributes of the index.
3344
3279
 
3345
3280
  Args:
3346
-
3347
3281
  body: List containing the searchable attributes.
3348
3282
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3349
3283
 
3350
3284
  Returns:
3351
-
3352
3285
  The details of the task status.
3353
3286
 
3354
3287
  Raises:
3355
-
3356
3288
  MeilisearchCommunicationError: If there was an error communicating with the server.
3357
3289
  MeilisearchApiError: If the Meilisearch API returned an error.
3358
3290
 
3359
- Examples:
3360
-
3291
+ Examples
3361
3292
  >>> from meilisearch_python_sdk import AsyncClient
3362
3293
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3363
3294
  >>> index = client.index("movies")
@@ -3373,16 +3304,13 @@ class AsyncIndex(_BaseIndex):
3373
3304
  """Reset searchable attributes of the index to default values.
3374
3305
 
3375
3306
  Returns:
3376
-
3377
3307
  The details of the task status.
3378
3308
 
3379
3309
  Raises:
3380
-
3381
3310
  MeilisearchCommunicationError: If there was an error communicating with the server.
3382
3311
  MeilisearchApiError: If the Meilisearch API returned an error.
3383
3312
 
3384
- Examples:
3385
-
3313
+ Examples
3386
3314
  >>> from meilisearch_python_sdk import AsyncClient
3387
3315
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3388
3316
  >>> index = client.index("movies")
@@ -3396,16 +3324,13 @@ class AsyncIndex(_BaseIndex):
3396
3324
  """Get displayed attributes of the index.
3397
3325
 
3398
3326
  Returns:
3399
-
3400
3327
  List containing the displayed attributes of the index.
3401
3328
 
3402
3329
  Raises:
3403
-
3404
3330
  MeilisearchCommunicationError: If there was an error communicating with the server.
3405
3331
  MeilisearchApiError: If the Meilisearch API returned an error.
3406
3332
 
3407
- Examples:
3408
-
3333
+ Examples
3409
3334
  >>> from meilisearch_python_sdk import AsyncClient
3410
3335
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3411
3336
  >>> index = client.index("movies")
@@ -3421,21 +3346,17 @@ class AsyncIndex(_BaseIndex):
3421
3346
  """Update displayed attributes of the index.
3422
3347
 
3423
3348
  Args:
3424
-
3425
3349
  body: List containing the displayed attributes.
3426
3350
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3427
3351
 
3428
3352
  Returns:
3429
-
3430
3353
  The details of the task status.
3431
3354
 
3432
3355
  Raises:
3433
-
3434
3356
  MeilisearchCommunicationError: If there was an error communicating with the server.
3435
3357
  MeilisearchApiError: If the Meilisearch API returned an error.
3436
3358
 
3437
- Examples:
3438
-
3359
+ Examples
3439
3360
  >>> from meilisearch_python_sdk import AsyncClient
3440
3361
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3441
3362
  >>> index = client.index("movies")
@@ -3453,16 +3374,13 @@ class AsyncIndex(_BaseIndex):
3453
3374
  """Reset displayed attributes of the index to default values.
3454
3375
 
3455
3376
  Returns:
3456
-
3457
3377
  The details of the task status.
3458
3378
 
3459
3379
  Raises:
3460
-
3461
3380
  MeilisearchCommunicationError: If there was an error communicating with the server.
3462
3381
  MeilisearchApiError: If the Meilisearch API returned an error.
3463
3382
 
3464
- Examples:
3465
-
3383
+ Examples
3466
3384
  >>> from meilisearch_python_sdk import AsyncClient
3467
3385
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3468
3386
  >>> index = client.index("movies")
@@ -3476,16 +3394,13 @@ class AsyncIndex(_BaseIndex):
3476
3394
  """Get stop words of the index.
3477
3395
 
3478
3396
  Returns:
3479
-
3480
3397
  List containing the stop words of the index.
3481
3398
 
3482
3399
  Raises:
3483
-
3484
3400
  MeilisearchCommunicationError: If there was an error communicating with the server.
3485
3401
  MeilisearchApiError: If the Meilisearch API returned an error.
3486
3402
 
3487
- Examples:
3488
-
3403
+ Examples
3489
3404
  >>> from meilisearch_python_sdk import AsyncClient
3490
3405
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3491
3406
  >>> index = client.index("movies")
@@ -3502,21 +3417,17 @@ class AsyncIndex(_BaseIndex):
3502
3417
  """Update stop words of the index.
3503
3418
 
3504
3419
  Args:
3505
-
3506
3420
  body: List containing the stop words of the index.
3507
3421
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3508
3422
 
3509
3423
  Returns:
3510
-
3511
3424
  The details of the task status.
3512
3425
 
3513
3426
  Raises:
3514
-
3515
3427
  MeilisearchCommunicationError: If there was an error communicating with the server.
3516
3428
  MeilisearchApiError: If the Meilisearch API returned an error.
3517
3429
 
3518
- Examples:
3519
-
3430
+ Examples
3520
3431
  >>> from meilisearch_python_sdk import AsyncClient
3521
3432
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3522
3433
  >>> index = client.index("movies")
@@ -3532,16 +3443,13 @@ class AsyncIndex(_BaseIndex):
3532
3443
  """Reset stop words of the index to default values.
3533
3444
 
3534
3445
  Returns:
3535
-
3536
3446
  The details of the task status.
3537
3447
 
3538
3448
  Raises:
3539
-
3540
3449
  MeilisearchCommunicationError: If there was an error communicating with the server.
3541
3450
  MeilisearchApiError: If the Meilisearch API returned an error.
3542
3451
 
3543
- Examples:
3544
-
3452
+ Examples
3545
3453
  >>> from meilisearch_python_sdk import AsyncClient
3546
3454
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3547
3455
  >>> index = client.index("movies")
@@ -3555,16 +3463,13 @@ class AsyncIndex(_BaseIndex):
3555
3463
  """Get synonyms of the index.
3556
3464
 
3557
3465
  Returns:
3558
-
3559
3466
  The synonyms of the index.
3560
3467
 
3561
3468
  Raises:
3562
-
3563
3469
  MeilisearchCommunicationError: If there was an error communicating with the server.
3564
3470
  MeilisearchApiError: If the Meilisearch API returned an error.
3565
3471
 
3566
- Examples:
3567
-
3472
+ Examples
3568
3473
  >>> from meilisearch_python_sdk import AsyncClient
3569
3474
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3570
3475
  >>> index = client.index("movies")
@@ -3583,21 +3488,17 @@ class AsyncIndex(_BaseIndex):
3583
3488
  """Update synonyms of the index.
3584
3489
 
3585
3490
  Args:
3586
-
3587
3491
  body: The synonyms of the index.
3588
3492
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3589
3493
 
3590
3494
  Returns:
3591
-
3592
3495
  The details of the task status.
3593
3496
 
3594
3497
  Raises:
3595
-
3596
3498
  MeilisearchCommunicationError: If there was an error communicating with the server.
3597
3499
  MeilisearchApiError: If the Meilisearch API returned an error.
3598
3500
 
3599
- Examples:
3600
-
3501
+ Examples
3601
3502
  >>> from meilisearch_python_sdk import AsyncClient
3602
3503
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3603
3504
  >>> index = client.index("movies")
@@ -3615,16 +3516,13 @@ class AsyncIndex(_BaseIndex):
3615
3516
  """Reset synonyms of the index to default values.
3616
3517
 
3617
3518
  Returns:
3618
-
3619
3519
  The details of the task status.
3620
3520
 
3621
3521
  Raises:
3622
-
3623
3522
  MeilisearchCommunicationError: If there was an error communicating with the server.
3624
3523
  MeilisearchApiError: If the Meilisearch API returned an error.
3625
3524
 
3626
- Examples:
3627
-
3525
+ Examples
3628
3526
  >>> from meilisearch_python_sdk import AsyncClient
3629
3527
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3630
3528
  >>> index = client.index("movies")
@@ -3638,16 +3536,13 @@ class AsyncIndex(_BaseIndex):
3638
3536
  """Get filterable attributes of the index.
3639
3537
 
3640
3538
  Returns:
3641
-
3642
3539
  List containing the filterable attributes of the index.
3643
3540
 
3644
3541
  Raises:
3645
-
3646
3542
  MeilisearchCommunicationError: If there was an error communicating with the server.
3647
3543
  MeilisearchApiError: If the Meilisearch API returned an error.
3648
3544
 
3649
- Examples:
3650
-
3545
+ Examples
3651
3546
  >>> from meilisearch_python_sdk import AsyncClient
3652
3547
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3653
3548
  >>> index = client.index("movies")
@@ -3666,21 +3561,17 @@ class AsyncIndex(_BaseIndex):
3666
3561
  """Update filterable attributes of the index.
3667
3562
 
3668
3563
  Args:
3669
-
3670
3564
  body: List containing the filterable attributes of the index.
3671
3565
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3672
3566
 
3673
3567
  Returns:
3674
-
3675
3568
  The details of the task status.
3676
3569
 
3677
3570
  Raises:
3678
-
3679
3571
  MeilisearchCommunicationError: If there was an error communicating with the server.
3680
3572
  MeilisearchApiError: If the Meilisearch API returned an error.
3681
3573
 
3682
- Examples:
3683
-
3574
+ Examples
3684
3575
  >>> from meilisearch_python_sdk import AsyncClient
3685
3576
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3686
3577
  >>> index = client.index("movies")
@@ -3696,16 +3587,13 @@ class AsyncIndex(_BaseIndex):
3696
3587
  """Reset filterable attributes of the index to default values.
3697
3588
 
3698
3589
  Returns:
3699
-
3700
3590
  The details of the task status.
3701
3591
 
3702
3592
  Raises:
3703
-
3704
3593
  MeilisearchCommunicationError: If there was an error communicating with the server.
3705
3594
  MeilisearchApiError: If the Meilisearch API returned an error.
3706
3595
 
3707
- Examples:
3708
-
3596
+ Examples
3709
3597
  >>> from meilisearch_python_sdk import AsyncClient
3710
3598
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3711
3599
  >>> index = client.index("movies")
@@ -3719,16 +3607,13 @@ class AsyncIndex(_BaseIndex):
3719
3607
  """Get sortable attributes of the AsyncIndex.
3720
3608
 
3721
3609
  Returns:
3722
-
3723
3610
  List containing the sortable attributes of the AsyncIndex.
3724
3611
 
3725
3612
  Raises:
3726
-
3727
3613
  MeilisearchCommunicationError: If there was an error communicating with the server.
3728
3614
  MeilisearchApiError: If the Meilisearch API returned an error.
3729
3615
 
3730
- Examples:
3731
-
3616
+ Examples
3732
3617
  >>> from meilisearch_python_sdk import AsyncClient
3733
3618
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3734
3619
  >>> index = client.index("movies")
@@ -3744,21 +3629,17 @@ class AsyncIndex(_BaseIndex):
3744
3629
  """Get sortable attributes of the AsyncIndex.
3745
3630
 
3746
3631
  Args:
3747
-
3748
3632
  sortable_attributes: List of attributes for searching.
3749
3633
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3750
3634
 
3751
3635
  Returns:
3752
-
3753
3636
  The details of the task status.
3754
3637
 
3755
3638
  Raises:
3756
-
3757
3639
  MeilisearchCommunicationError: If there was an error communicating with the server.
3758
3640
  MeilisearchApiError: If the Meilisearch API returned an error.
3759
3641
 
3760
- Examples:
3761
-
3642
+ Examples
3762
3643
  >>> from meilisearch_python_sdk import AsyncClient
3763
3644
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3764
3645
  >>> index = client.index("movies")
@@ -3774,16 +3655,13 @@ class AsyncIndex(_BaseIndex):
3774
3655
  """Reset sortable attributes of the index to default values.
3775
3656
 
3776
3657
  Returns:
3777
-
3778
3658
  The details of the task status.
3779
3659
 
3780
3660
  Raises:
3781
-
3782
3661
  MeilisearchCommunicationError: If there was an error communicating with the server.
3783
3662
  MeilisearchApiError: If the Meilisearch API returned an error.
3784
3663
 
3785
- Examples:
3786
-
3664
+ Examples
3787
3665
  >>> from meilisearch_python_sdk import AsyncClient
3788
3666
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3789
3667
  >>> index = client.index("movies")
@@ -3797,16 +3675,13 @@ class AsyncIndex(_BaseIndex):
3797
3675
  """Get typo tolerance for the index.
3798
3676
 
3799
3677
  Returns:
3800
-
3801
3678
  TypoTolerance for the index.
3802
3679
 
3803
3680
  Raises:
3804
-
3805
3681
  MeilisearchCommunicationError: If there was an error communicating with the server.
3806
3682
  MeilisearchApiError: If the Meilisearch API returned an error.
3807
3683
 
3808
- Examples:
3809
-
3684
+ Examples
3810
3685
  >>> from meilisearch_python_sdk import AsyncClient
3811
3686
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3812
3687
  >>> index = client.index("movies")
@@ -3822,21 +3697,17 @@ class AsyncIndex(_BaseIndex):
3822
3697
  """Update typo tolerance.
3823
3698
 
3824
3699
  Args:
3825
-
3826
3700
  typo_tolerance: Typo tolerance settings.
3827
3701
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3828
3702
 
3829
3703
  Returns:
3830
-
3831
3704
  Task to track the action.
3832
3705
 
3833
3706
  Raises:
3834
-
3835
3707
  MeilisearchCommunicationError: If there was an error communicating with the server.
3836
3708
  MeilisearchApiError: If the Meilisearch API returned an error.
3837
3709
 
3838
- Examples:
3839
-
3710
+ Examples
3840
3711
  >>> from meilisearch_python_sdk import AsyncClient
3841
3712
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3842
3713
  >>> index = client.index("movies")
@@ -3855,16 +3726,13 @@ class AsyncIndex(_BaseIndex):
3855
3726
  """Reset typo tolerance to default values.
3856
3727
 
3857
3728
  Returns:
3858
-
3859
3729
  The details of the task status.
3860
3730
 
3861
3731
  Raises:
3862
-
3863
3732
  MeilisearchCommunicationError: If there was an error communicating with the server.
3864
3733
  MeilisearchApiError: If the Meilisearch API returned an error.
3865
3734
 
3866
- Examples:
3867
-
3735
+ Examples
3868
3736
  >>> from meilisearch_python_sdk import AsyncClient
3869
3737
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3870
3738
  >>> index = client.index("movies")
@@ -3878,16 +3746,13 @@ class AsyncIndex(_BaseIndex):
3878
3746
  """Get faceting for the index.
3879
3747
 
3880
3748
  Returns:
3881
-
3882
3749
  Faceting for the index.
3883
3750
 
3884
3751
  Raises:
3885
-
3886
3752
  MeilisearchCommunicationError: If there was an error communicating with the server.
3887
3753
  MeilisearchApiError: If the Meilisearch API returned an error.
3888
3754
 
3889
- Examples:
3890
-
3755
+ Examples
3891
3756
  >>> from meilisearch_python_sdk import AsyncClient
3892
3757
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3893
3758
  >>> index = client.index("movies")
@@ -3901,21 +3766,17 @@ class AsyncIndex(_BaseIndex):
3901
3766
  """Partially update the faceting settings for an index.
3902
3767
 
3903
3768
  Args:
3904
-
3905
3769
  faceting: Faceting values.
3906
3770
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3907
3771
 
3908
3772
  Returns:
3909
-
3910
3773
  Task to track the action.
3911
3774
 
3912
3775
  Raises:
3913
-
3914
3776
  MeilisearchCommunicationError: If there was an error communicating with the server.
3915
3777
  MeilisearchApiError: If the Meilisearch API returned an error.
3916
3778
 
3917
- Examples:
3918
-
3779
+ Examples
3919
3780
  >>> from meilisearch_python_sdk import AsyncClient
3920
3781
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3921
3782
  >>> index = client.index("movies")
@@ -3933,16 +3794,13 @@ class AsyncIndex(_BaseIndex):
3933
3794
  """Reset an index's faceting settings to their default value.
3934
3795
 
3935
3796
  Returns:
3936
-
3937
3797
  The details of the task status.
3938
3798
 
3939
3799
  Raises:
3940
-
3941
3800
  MeilisearchCommunicationError: If there was an error communicating with the server.
3942
3801
  MeilisearchApiError: If the Meilisearch API returned an error.
3943
3802
 
3944
- Examples:
3945
-
3803
+ Examples
3946
3804
  >>> from meilisearch_python_sdk import AsyncClient
3947
3805
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3948
3806
  >>> index = client.index("movies")
@@ -3956,16 +3814,13 @@ class AsyncIndex(_BaseIndex):
3956
3814
  """Get pagination settings for the index.
3957
3815
 
3958
3816
  Returns:
3959
-
3960
3817
  Pagination for the index.
3961
3818
 
3962
3819
  Raises:
3963
-
3964
3820
  MeilisearchCommunicationError: If there was an error communicating with the server.
3965
3821
  MeilisearchApiError: If the Meilisearch API returned an error.
3966
3822
 
3967
- Examples:
3968
-
3823
+ Examples
3969
3824
  >>> from meilisearch_async_client import AsyncClient
3970
3825
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
3971
3826
  >>> index = client.index("movies")
@@ -3979,21 +3834,17 @@ class AsyncIndex(_BaseIndex):
3979
3834
  """Partially update the pagination settings for an index.
3980
3835
 
3981
3836
  Args:
3982
-
3983
3837
  settings: settings for pagination.
3984
3838
  compress: If set to True the data will be sent in gzip format. Defaults to False.
3985
3839
 
3986
3840
  Returns:
3987
-
3988
3841
  Task to track the action.
3989
3842
 
3990
3843
  Raises:
3991
-
3992
3844
  MeilisearchCommunicationError: If there was an error communicating with the server.
3993
3845
  MeilisearchApiError: If the Meilisearch API returned an error.
3994
3846
 
3995
- Examples:
3996
-
3847
+ Examples
3997
3848
  >>> from meilisearch_python_sdk import AsyncClient
3998
3849
  >>> from meilisearch_python_sdk.models.settings import Pagination
3999
3850
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -4012,16 +3863,13 @@ class AsyncIndex(_BaseIndex):
4012
3863
  """Reset an index's pagination settings to their default value.
4013
3864
 
4014
3865
  Returns:
4015
-
4016
3866
  The details of the task status.
4017
3867
 
4018
3868
  Raises:
4019
-
4020
3869
  MeilisearchCommunicationError: If there was an error communicating with the server.
4021
3870
  MeilisearchApiError: If the Meilisearch API returned an error.
4022
3871
 
4023
- Examples:
4024
-
3872
+ Examples
4025
3873
  >>> from meilisearch_async_client import AsyncClient
4026
3874
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4027
3875
  >>> index = client.index("movies")
@@ -4035,16 +3883,13 @@ class AsyncIndex(_BaseIndex):
4035
3883
  """Get separator token settings for the index.
4036
3884
 
4037
3885
  Returns:
4038
-
4039
3886
  Separator tokens for the index.
4040
3887
 
4041
3888
  Raises:
4042
-
4043
3889
  MeilisearchCommunicationError: If there was an error communicating with the server.
4044
3890
  MeilisearchApiError: If the Meilisearch API returned an error.
4045
3891
 
4046
- Examples:
4047
-
3892
+ Examples
4048
3893
  >>> from meilisearch_async_client import AsyncClient
4049
3894
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4050
3895
  >>> index = client.index("movies")
@@ -4060,21 +3905,17 @@ class AsyncIndex(_BaseIndex):
4060
3905
  """Update the separator tokens settings for an index.
4061
3906
 
4062
3907
  Args:
4063
-
4064
3908
  separator_tokens: List of separator tokens.
4065
3909
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4066
3910
 
4067
3911
  Returns:
4068
-
4069
3912
  Task to track the action.
4070
3913
 
4071
3914
  Raises:
4072
-
4073
3915
  MeilisearchCommunicationError: If there was an error communicating with the server.
4074
3916
  MeilisearchApiError: If the Meilisearch API returned an error.
4075
3917
 
4076
- Examples:
4077
-
3918
+ Examples
4078
3919
  >>> from meilisearch_python_sdk import AsyncClient
4079
3920
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4080
3921
  >>> index = client.index("movies")
@@ -4090,16 +3931,13 @@ class AsyncIndex(_BaseIndex):
4090
3931
  """Reset an index's separator tokens settings to the default value.
4091
3932
 
4092
3933
  Returns:
4093
-
4094
3934
  The details of the task status.
4095
3935
 
4096
3936
  Raises:
4097
-
4098
3937
  MeilisearchCommunicationError: If there was an error communicating with the server.
4099
3938
  MeilisearchApiError: If the Meilisearch API returned an error.
4100
3939
 
4101
- Examples:
4102
-
3940
+ Examples
4103
3941
  >>> from meilisearch_async_client import AsyncClient
4104
3942
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4105
3943
  >>> index = client.index("movies")
@@ -4113,16 +3951,13 @@ class AsyncIndex(_BaseIndex):
4113
3951
  """Get non-separator token settings for the index.
4114
3952
 
4115
3953
  Returns:
4116
-
4117
3954
  Non-separator tokens for the index.
4118
3955
 
4119
3956
  Raises:
4120
-
4121
3957
  MeilisearchCommunicationError: If there was an error communicating with the server.
4122
3958
  MeilisearchApiError: If the Meilisearch API returned an error.
4123
3959
 
4124
- Examples:
4125
-
3960
+ Examples
4126
3961
  >>> from meilisearch_async_client import AsyncClient
4127
3962
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4128
3963
  >>> index = client.index("movies")
@@ -4138,21 +3973,17 @@ class AsyncIndex(_BaseIndex):
4138
3973
  """Update the non-separator tokens settings for an index.
4139
3974
 
4140
3975
  Args:
4141
-
4142
3976
  non_separator_tokens: List of non-separator tokens.
4143
3977
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4144
3978
 
4145
3979
  Returns:
4146
-
4147
3980
  Task to track the action.
4148
3981
 
4149
3982
  Raises:
4150
-
4151
3983
  MeilisearchCommunicationError: If there was an error communicating with the server.
4152
3984
  MeilisearchApiError: If the Meilisearch API returned an error.
4153
3985
 
4154
- Examples:
4155
-
3986
+ Examples
4156
3987
  >>> from meilisearch_python_sdk import AsyncClient
4157
3988
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4158
3989
  >>> index = client.index("movies")
@@ -4168,16 +3999,13 @@ class AsyncIndex(_BaseIndex):
4168
3999
  """Reset an index's non-separator tokens settings to the default value.
4169
4000
 
4170
4001
  Returns:
4171
-
4172
4002
  The details of the task status.
4173
4003
 
4174
4004
  Raises:
4175
-
4176
4005
  MeilisearchCommunicationError: If there was an error communicating with the server.
4177
4006
  MeilisearchApiError: If the Meilisearch API returned an error.
4178
4007
 
4179
- Examples:
4180
-
4008
+ Examples
4181
4009
  >>> from meilisearch_async_client import AsyncClient
4182
4010
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4183
4011
  >>> index = client.index("movies")
@@ -4191,16 +4019,13 @@ class AsyncIndex(_BaseIndex):
4191
4019
  """Get search cutoff time in ms.
4192
4020
 
4193
4021
  Returns:
4194
-
4195
4022
  Integer representing the search cutoff time in ms, or None.
4196
4023
 
4197
4024
  Raises:
4198
-
4199
4025
  MeilisearchCommunicationError: If there was an error communicating with the server.
4200
4026
  MeilisearchApiError: If the Meilisearch API returned an error.
4201
4027
 
4202
- Examples:
4203
-
4028
+ Examples
4204
4029
  >>> from meilisearch_async_client import AsyncClient
4205
4030
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4206
4031
  >>> index = client.index("movies")
@@ -4216,21 +4041,17 @@ class AsyncIndex(_BaseIndex):
4216
4041
  """Update the search cutoff for an index.
4217
4042
 
4218
4043
  Args:
4219
-
4220
4044
  search_cutoff_ms: Integer value of the search cutoff time in ms.
4221
4045
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4222
4046
 
4223
4047
  Returns:
4224
-
4225
4048
  The details of the task status.
4226
4049
 
4227
4050
  Raises:
4228
-
4229
4051
  MeilisearchCommunicationError: If there was an error communicating with the server.
4230
4052
  MeilisearchApiError: If the Meilisearch API returned an error.
4231
4053
 
4232
- Examples:
4233
-
4054
+ Examples
4234
4055
  >>> from meilisearch_python_sdk import AsyncClient
4235
4056
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4236
4057
  >>> index = client.index("movies")
@@ -4246,16 +4067,13 @@ class AsyncIndex(_BaseIndex):
4246
4067
  """Reset the search cutoff time to the default value.
4247
4068
 
4248
4069
  Returns:
4249
-
4250
4070
  The details of the task status.
4251
4071
 
4252
4072
  Raises:
4253
-
4254
4073
  MeilisearchCommunicationError: If there was an error communicating with the server.
4255
4074
  MeilisearchApiError: If the Meilisearch API returned an error.
4256
4075
 
4257
- Examples:
4258
-
4076
+ Examples
4259
4077
  >>> from meilisearch_async_client import AsyncClient
4260
4078
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4261
4079
  >>> index = client.index("movies")
@@ -4269,16 +4087,13 @@ class AsyncIndex(_BaseIndex):
4269
4087
  """Get word dictionary settings for the index.
4270
4088
 
4271
4089
  Returns:
4272
-
4273
4090
  Word dictionary for the index.
4274
4091
 
4275
4092
  Raises:
4276
-
4277
4093
  MeilisearchCommunicationError: If there was an error communicating with the server.
4278
4094
  MeilisearchApiError: If the Meilisearch API returned an error.
4279
4095
 
4280
- Examples:
4281
-
4096
+ Examples
4282
4097
  >>> from meilisearch_async_client import AsyncClient
4283
4098
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4284
4099
  >>> index = client.index("movies")
@@ -4294,21 +4109,17 @@ class AsyncIndex(_BaseIndex):
4294
4109
  """Update the word dictionary settings for an index.
4295
4110
 
4296
4111
  Args:
4297
-
4298
4112
  dictionary: List of dictionary values.
4299
4113
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4300
4114
 
4301
4115
  Returns:
4302
-
4303
4116
  Task to track the action.
4304
4117
 
4305
4118
  Raises:
4306
-
4307
4119
  MeilisearchCommunicationError: If there was an error communicating with the server.
4308
4120
  MeilisearchApiError: If the Meilisearch API returned an error.
4309
4121
 
4310
- Examples:
4311
-
4122
+ Examples
4312
4123
  >>> from meilisearch_python_sdk import AsyncClient
4313
4124
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4314
4125
  >>> index = client.index("movies")
@@ -4324,16 +4135,13 @@ class AsyncIndex(_BaseIndex):
4324
4135
  """Reset an index's word dictionary settings to the default value.
4325
4136
 
4326
4137
  Returns:
4327
-
4328
4138
  The details of the task status.
4329
4139
 
4330
4140
  Raises:
4331
-
4332
4141
  MeilisearchCommunicationError: If there was an error communicating with the server.
4333
4142
  MeilisearchApiError: If the Meilisearch API returned an error.
4334
4143
 
4335
- Examples:
4336
-
4144
+ Examples
4337
4145
  >>> from meilisearch_async_client import AsyncClient
4338
4146
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4339
4147
  >>> index = client.index("movies")
@@ -4347,16 +4155,13 @@ class AsyncIndex(_BaseIndex):
4347
4155
  """Get proximity precision settings for the index.
4348
4156
 
4349
4157
  Returns:
4350
-
4351
4158
  Proximity precision for the index.
4352
4159
 
4353
4160
  Raises:
4354
-
4355
4161
  MeilisearchCommunicationError: If there was an error communicating with the server.
4356
4162
  MeilisearchApiError: If the Meilisearch API returned an error.
4357
4163
 
4358
- Examples:
4359
-
4164
+ Examples
4360
4165
  >>> from meilisearch_async_client import AsyncClient
4361
4166
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4362
4167
  >>> index = client.index("movies")
@@ -4372,21 +4177,17 @@ class AsyncIndex(_BaseIndex):
4372
4177
  """Update the proximity precision settings for an index.
4373
4178
 
4374
4179
  Args:
4375
-
4376
4180
  proximity_precision: The proximity precision value.
4377
4181
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4378
4182
 
4379
4183
  Returns:
4380
-
4381
4184
  Task to track the action.
4382
4185
 
4383
4186
  Raises:
4384
-
4385
4187
  MeilisearchCommunicationError: If there was an error communicating with the server.
4386
4188
  MeilisearchApiError: If the Meilisearch API returned an error.
4387
4189
 
4388
- Examples:
4389
-
4190
+ Examples
4390
4191
  >>> from meilisearch_python_sdk import AsyncClient
4391
4192
  >>> from meilisearch_python_sdk.models.settings import ProximityPrecision
4392
4193
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -4405,16 +4206,13 @@ class AsyncIndex(_BaseIndex):
4405
4206
  """Reset an index's proximity precision settings to the default value.
4406
4207
 
4407
4208
  Returns:
4408
-
4409
4209
  The details of the task status.
4410
4210
 
4411
4211
  Raises:
4412
-
4413
4212
  MeilisearchCommunicationError: If there was an error communicating with the server.
4414
4213
  MeilisearchApiError: If the Meilisearch API returned an error.
4415
4214
 
4416
- Examples:
4417
-
4215
+ Examples
4418
4216
  >>> from meilisearch_async_client import AsyncClient
4419
4217
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4420
4218
  >>> index = client.index("movies")
@@ -4428,16 +4226,13 @@ class AsyncIndex(_BaseIndex):
4428
4226
  """Get embedder settings for the index.
4429
4227
 
4430
4228
  Returns:
4431
-
4432
4229
  Embedders for the index.
4433
4230
 
4434
4231
  Raises:
4435
-
4436
4232
  MeilisearchCommunicationError: If there was an error communicating with the server.
4437
4233
  MeilisearchApiError: If the Meilisearch API returned an error.
4438
4234
 
4439
- Examples:
4440
-
4235
+ Examples
4441
4236
  >>> from meilisearch_async_client import AsyncClient
4442
4237
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4443
4238
  >>> index = client.index("movies")
@@ -4451,21 +4246,17 @@ class AsyncIndex(_BaseIndex):
4451
4246
  """Update the embedders settings for an index.
4452
4247
 
4453
4248
  Args:
4454
-
4455
4249
  embedders: The embedders value.
4456
4250
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4457
4251
 
4458
4252
  Returns:
4459
-
4460
4253
  Task to track the action.
4461
4254
 
4462
4255
  Raises:
4463
-
4464
4256
  MeilisearchCommunicationError: If there was an error communicating with the server.
4465
4257
  MeilisearchApiError: If the Meilisearch API returned an error.
4466
4258
 
4467
- Examples:
4468
-
4259
+ Examples
4469
4260
  >>> from meilisearch_python_sdk import AsyncClient
4470
4261
  >>> from meilisearch_python_sdk.models.settings import Embedders, UserProvidedEmbedder
4471
4262
  >>>
@@ -4492,16 +4283,13 @@ class AsyncIndex(_BaseIndex):
4492
4283
  """Reset an index's embedders settings to the default value.
4493
4284
 
4494
4285
  Returns:
4495
-
4496
4286
  The details of the task status.
4497
4287
 
4498
4288
  Raises:
4499
-
4500
4289
  MeilisearchCommunicationError: If there was an error communicating with the server.
4501
4290
  MeilisearchApiError: If the Meilisearch API returned an error.
4502
4291
 
4503
- Examples:
4504
-
4292
+ Examples
4505
4293
  >>> from meilisearch_async_client import AsyncClient
4506
4294
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4507
4295
  >>> index = client.index("movies")
@@ -4515,16 +4303,13 @@ class AsyncIndex(_BaseIndex):
4515
4303
  """Get localized attributes settings for the index.
4516
4304
 
4517
4305
  Returns:
4518
-
4519
4306
  Localized attributes for the index.
4520
4307
 
4521
4308
  Raises:
4522
-
4523
4309
  MeilisearchCommunicationError: If there was an error communicating with the server.
4524
4310
  MeilisearchApiError: If the Meilisearch API returned an error.
4525
4311
 
4526
- Examples:
4527
-
4312
+ Examples
4528
4313
  >>> from meilisearch_async_client import AsyncClient
4529
4314
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4530
4315
  >>> index = client.index("movies")
@@ -4543,21 +4328,17 @@ class AsyncIndex(_BaseIndex):
4543
4328
  """Update the localized attributes settings for an index.
4544
4329
 
4545
4330
  Args:
4546
-
4547
4331
  localized_attributes: The localized attributes value.
4548
4332
  compress: If set to True the data will be sent in gzip format. Defaults to False.
4549
4333
 
4550
4334
  Returns:
4551
-
4552
4335
  Task to track the action.
4553
4336
 
4554
4337
  Raises:
4555
-
4556
4338
  MeilisearchCommunicationError: If there was an error communicating with the server.
4557
4339
  MeilisearchApiError: If the Meilisearch API returned an error.
4558
4340
 
4559
- Examples:
4560
-
4341
+ Examples
4561
4342
  >>> from meilisearch_python_sdk import AsyncClient
4562
4343
  >>> from meilisearch_python_sdk.models.settings import LocalizedAttributes
4563
4344
  >>>
@@ -4580,16 +4361,13 @@ class AsyncIndex(_BaseIndex):
4580
4361
  """Reset an index's localized attributes settings to the default value.
4581
4362
 
4582
4363
  Returns:
4583
-
4584
4364
  The details of the task status.
4585
4365
 
4586
4366
  Raises:
4587
-
4588
4367
  MeilisearchCommunicationError: If there was an error communicating with the server.
4589
4368
  MeilisearchApiError: If the Meilisearch API returned an error.
4590
4369
 
4591
- Examples:
4592
-
4370
+ Examples
4593
4371
  >>> from meilisearch_async_client import AsyncClient
4594
4372
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
4595
4373
  >>> index = client.index("movies")
@@ -4689,7 +4467,6 @@ class Index(_BaseIndex):
4689
4467
  """Class initializer.
4690
4468
 
4691
4469
  Args:
4692
-
4693
4470
  http_client: An instance of the Client. This automatically gets passed by the
4694
4471
  Client when creating and Index instance.
4695
4472
  uid: The index's unique identifier.
@@ -4721,10 +4498,7 @@ class Index(_BaseIndex):
4721
4498
  if not self.plugins or not self.plugins.add_documents_plugins:
4722
4499
  return None
4723
4500
 
4724
- plugins = []
4725
- for plugin in self.plugins.add_documents_plugins:
4726
- if plugin.POST_EVENT:
4727
- plugins.append(plugin)
4501
+ plugins = [plugin for plugin in self.plugins.add_documents_plugins if plugin.POST_EVENT]
4728
4502
 
4729
4503
  if not plugins:
4730
4504
  return None
@@ -4736,10 +4510,7 @@ class Index(_BaseIndex):
4736
4510
  if not self.plugins or not self.plugins.add_documents_plugins:
4737
4511
  return None
4738
4512
 
4739
- plugins = []
4740
- for plugin in self.plugins.add_documents_plugins:
4741
- if plugin.PRE_EVENT:
4742
- plugins.append(plugin)
4513
+ plugins = [plugin for plugin in self.plugins.add_documents_plugins if plugin.PRE_EVENT]
4743
4514
 
4744
4515
  if not plugins:
4745
4516
  return None
@@ -4751,10 +4522,9 @@ class Index(_BaseIndex):
4751
4522
  if not self.plugins or not self.plugins.delete_all_documents_plugins:
4752
4523
  return None
4753
4524
 
4754
- plugins = []
4755
- for plugin in self.plugins.delete_all_documents_plugins:
4756
- if plugin.POST_EVENT:
4757
- plugins.append(plugin)
4525
+ plugins = [
4526
+ plugin for plugin in self.plugins.delete_all_documents_plugins if plugin.POST_EVENT
4527
+ ]
4758
4528
 
4759
4529
  if not plugins:
4760
4530
  return None
@@ -4766,10 +4536,9 @@ class Index(_BaseIndex):
4766
4536
  if not self.plugins or not self.plugins.delete_all_documents_plugins:
4767
4537
  return None
4768
4538
 
4769
- plugins = []
4770
- for plugin in self.plugins.delete_all_documents_plugins:
4771
- if plugin.PRE_EVENT:
4772
- plugins.append(plugin)
4539
+ plugins = [
4540
+ plugin for plugin in self.plugins.delete_all_documents_plugins if plugin.PRE_EVENT
4541
+ ]
4773
4542
 
4774
4543
  if not plugins:
4775
4544
  return None
@@ -4781,10 +4550,7 @@ class Index(_BaseIndex):
4781
4550
  if not self.plugins or not self.plugins.delete_document_plugins:
4782
4551
  return None
4783
4552
 
4784
- plugins = []
4785
- for plugin in self.plugins.delete_document_plugins:
4786
- if plugin.POST_EVENT:
4787
- plugins.append(plugin)
4553
+ plugins = [plugin for plugin in self.plugins.delete_document_plugins if plugin.POST_EVENT]
4788
4554
 
4789
4555
  if not plugins:
4790
4556
  return None
@@ -4796,10 +4562,7 @@ class Index(_BaseIndex):
4796
4562
  if not self.plugins or not self.plugins.delete_document_plugins:
4797
4563
  return None
4798
4564
 
4799
- plugins = []
4800
- for plugin in self.plugins.delete_document_plugins:
4801
- if plugin.PRE_EVENT:
4802
- plugins.append(plugin)
4565
+ plugins = [plugin for plugin in self.plugins.delete_document_plugins if plugin.PRE_EVENT]
4803
4566
 
4804
4567
  if not plugins:
4805
4568
  return None
@@ -4811,10 +4574,7 @@ class Index(_BaseIndex):
4811
4574
  if not self.plugins or not self.plugins.delete_documents_plugins:
4812
4575
  return None
4813
4576
 
4814
- plugins = []
4815
- for plugin in self.plugins.delete_documents_plugins:
4816
- if plugin.POST_EVENT:
4817
- plugins.append(plugin)
4577
+ plugins = [plugin for plugin in self.plugins.delete_documents_plugins if plugin.POST_EVENT]
4818
4578
 
4819
4579
  if not plugins:
4820
4580
  return None
@@ -4826,10 +4586,7 @@ class Index(_BaseIndex):
4826
4586
  if not self.plugins or not self.plugins.delete_documents_plugins:
4827
4587
  return None
4828
4588
 
4829
- plugins = []
4830
- for plugin in self.plugins.delete_documents_plugins:
4831
- if plugin.PRE_EVENT:
4832
- plugins.append(plugin)
4589
+ plugins = [plugin for plugin in self.plugins.delete_documents_plugins if plugin.PRE_EVENT]
4833
4590
 
4834
4591
  if not plugins:
4835
4592
  return None
@@ -4841,10 +4598,11 @@ class Index(_BaseIndex):
4841
4598
  if not self.plugins or not self.plugins.delete_documents_by_filter_plugins:
4842
4599
  return None
4843
4600
 
4844
- plugins = []
4845
- for plugin in self.plugins.delete_documents_by_filter_plugins:
4846
- if plugin.POST_EVENT:
4847
- plugins.append(plugin)
4601
+ plugins = [
4602
+ plugin
4603
+ for plugin in self.plugins.delete_documents_by_filter_plugins
4604
+ if plugin.POST_EVENT
4605
+ ]
4848
4606
 
4849
4607
  if not plugins:
4850
4608
  return None
@@ -4856,10 +4614,9 @@ class Index(_BaseIndex):
4856
4614
  if not self.plugins or not self.plugins.delete_documents_by_filter_plugins:
4857
4615
  return None
4858
4616
 
4859
- plugins = []
4860
- for plugin in self.plugins.delete_documents_by_filter_plugins:
4861
- if plugin.PRE_EVENT:
4862
- plugins.append(plugin)
4617
+ plugins = [
4618
+ plugin for plugin in self.plugins.delete_documents_by_filter_plugins if plugin.PRE_EVENT
4619
+ ]
4863
4620
 
4864
4621
  if not plugins:
4865
4622
  return None
@@ -4871,10 +4628,7 @@ class Index(_BaseIndex):
4871
4628
  if not self.plugins or not self.plugins.facet_search_plugins:
4872
4629
  return None
4873
4630
 
4874
- plugins = []
4875
- for plugin in self.plugins.facet_search_plugins:
4876
- if plugin.POST_EVENT:
4877
- plugins.append(plugin)
4631
+ plugins = [plugin for plugin in self.plugins.facet_search_plugins if plugin.POST_EVENT]
4878
4632
 
4879
4633
  if not plugins:
4880
4634
  return None
@@ -4886,10 +4640,7 @@ class Index(_BaseIndex):
4886
4640
  if not self.plugins or not self.plugins.facet_search_plugins:
4887
4641
  return None
4888
4642
 
4889
- plugins = []
4890
- for plugin in self.plugins.facet_search_plugins:
4891
- if plugin.PRE_EVENT:
4892
- plugins.append(plugin)
4643
+ plugins = [plugin for plugin in self.plugins.facet_search_plugins if plugin.PRE_EVENT]
4893
4644
 
4894
4645
  if not plugins:
4895
4646
  return None
@@ -4901,10 +4652,7 @@ class Index(_BaseIndex):
4901
4652
  if not self.plugins or not self.plugins.search_plugins:
4902
4653
  return None
4903
4654
 
4904
- plugins = []
4905
- for plugin in self.plugins.search_plugins:
4906
- if plugin.POST_EVENT:
4907
- plugins.append(plugin)
4655
+ plugins = [plugin for plugin in self.plugins.search_plugins if plugin.POST_EVENT]
4908
4656
 
4909
4657
  if not plugins:
4910
4658
  return None
@@ -4916,10 +4664,7 @@ class Index(_BaseIndex):
4916
4664
  if not self.plugins or not self.plugins.search_plugins:
4917
4665
  return None
4918
4666
 
4919
- plugins = []
4920
- for plugin in self.plugins.search_plugins:
4921
- if plugin.PRE_EVENT:
4922
- plugins.append(plugin)
4667
+ plugins = [plugin for plugin in self.plugins.search_plugins if plugin.PRE_EVENT]
4923
4668
 
4924
4669
  if not plugins:
4925
4670
  return None
@@ -4931,10 +4676,7 @@ class Index(_BaseIndex):
4931
4676
  if not self.plugins or not self.plugins.update_documents_plugins:
4932
4677
  return None
4933
4678
 
4934
- plugins = []
4935
- for plugin in self.plugins.update_documents_plugins:
4936
- if plugin.POST_EVENT:
4937
- plugins.append(plugin)
4679
+ plugins = [plugin for plugin in self.plugins.update_documents_plugins if plugin.POST_EVENT]
4938
4680
 
4939
4681
  if not plugins:
4940
4682
  return None
@@ -4946,10 +4688,7 @@ class Index(_BaseIndex):
4946
4688
  if not self.plugins or not self.plugins.update_documents_plugins:
4947
4689
  return None
4948
4690
 
4949
- plugins = []
4950
- for plugin in self.plugins.update_documents_plugins:
4951
- if plugin.PRE_EVENT:
4952
- plugins.append(plugin)
4691
+ plugins = [plugin for plugin in self.plugins.update_documents_plugins if plugin.PRE_EVENT]
4953
4692
 
4954
4693
  if not plugins:
4955
4694
  return None
@@ -4960,16 +4699,13 @@ class Index(_BaseIndex):
4960
4699
  """Deletes the index.
4961
4700
 
4962
4701
  Returns:
4963
-
4964
4702
  The details of the task.
4965
4703
 
4966
4704
  Raises:
4967
-
4968
4705
  MeilisearchCommunicationError: If there was an error communicating with the server.
4969
4706
  MeilisearchApiError: If the Meilisearch API returned an error.
4970
4707
 
4971
- Examples:
4972
-
4708
+ Examples
4973
4709
  >>> from meilisearch_python_sdk import Client
4974
4710
  >>> client = Client("http://localhost.com", "masterKey")
4975
4711
  >>> index = client.index("movies")
@@ -4982,16 +4718,13 @@ class Index(_BaseIndex):
4982
4718
  """Delete the index if it already exists.
4983
4719
 
4984
4720
  Returns:
4985
-
4986
4721
  True if the index was deleted or False if not.
4987
4722
 
4988
4723
  Raises:
4989
-
4990
4724
  MeilisearchCommunicationError: If there was an error communicating with the server.
4991
4725
  MeilisearchApiError: If the Meilisearch API returned an error.
4992
4726
 
4993
- Examples:
4994
-
4727
+ Examples
4995
4728
  >>> from meilisearch_python_sdk import Client
4996
4729
  >>> client = Client("http://localhost.com", "masterKey")
4997
4730
  >>> index = client.index("movies")
@@ -5008,20 +4741,16 @@ class Index(_BaseIndex):
5008
4741
  """Update the index primary key.
5009
4742
 
5010
4743
  Args:
5011
-
5012
4744
  primary_key: The primary key of the documents.
5013
4745
 
5014
4746
  Returns:
5015
-
5016
4747
  An instance of the AsyncIndex with the updated information.
5017
4748
 
5018
4749
  Raises:
5019
-
5020
4750
  MeilisearchCommunicationError: If there was an error communicating with the server.
5021
4751
  MeilisearchApiError: If the Meilisearch API returned an error.
5022
4752
 
5023
- Examples:
5024
-
4753
+ Examples
5025
4754
  >>> from meilisearch_python_sdk import Client
5026
4755
  >>> client = Client("http://localhost.com", "masterKey")
5027
4756
  >>> index = client.index("movies")
@@ -5038,16 +4767,13 @@ class Index(_BaseIndex):
5038
4767
  """Gets the infromation about the index.
5039
4768
 
5040
4769
  Returns:
5041
-
5042
4770
  An instance of the AsyncIndex containing the retrieved information.
5043
4771
 
5044
4772
  Raises:
5045
-
5046
4773
  MeilisearchCommunicationError: If there was an error communicating with the server.
5047
4774
  MeilisearchApiError: If the Meilisearch API returned an error.
5048
4775
 
5049
- Examples:
5050
-
4776
+ Examples
5051
4777
  >>> from meilisearch_python_sdk import Client
5052
4778
  >>> client = Client("http://localhost.com", "masterKey")
5053
4779
  >>> index = client.index("movies")
@@ -5064,16 +4790,13 @@ class Index(_BaseIndex):
5064
4790
  """Get the primary key.
5065
4791
 
5066
4792
  Returns:
5067
-
5068
4793
  The primary key for the documents in the index.
5069
4794
 
5070
4795
  Raises:
5071
-
5072
4796
  MeilisearchCommunicationError: If there was an error communicating with the server.
5073
4797
  MeilisearchApiError: If the Meilisearch API returned an error.
5074
4798
 
5075
- Examples:
5076
-
4799
+ Examples
5077
4800
  >>> from meilisearch_python_sdk import Client
5078
4801
  >>> client = Client("http://localhost.com", "masterKey")
5079
4802
  >>> index = client.index("movies")
@@ -5102,7 +4825,6 @@ class Index(_BaseIndex):
5102
4825
  through the `Client`.
5103
4826
 
5104
4827
  Args:
5105
-
5106
4828
  http_client: An instance of the Client. This automatically gets passed by the Client
5107
4829
  when creating an Index instance.
5108
4830
  uid: The index's unique identifier.
@@ -5127,16 +4849,13 @@ class Index(_BaseIndex):
5127
4849
  JsonDict
5128
4850
 
5129
4851
  Returns:
5130
-
5131
4852
  An instance of Index containing the information of the newly created index.
5132
4853
 
5133
4854
  Raises:
5134
-
5135
4855
  MeilisearchCommunicationError: If there was an error communicating with the server.
5136
4856
  MeilisearchApiError: If the Meilisearch API returned an error.
5137
4857
 
5138
- Examples:
5139
-
4858
+ Examples
5140
4859
  >>> from meilisearch_python_sdk import Client
5141
4860
  >>> client = Client("http://localhost.com", "masterKey")
5142
4861
  >>> index = index.create(client, "movies")
@@ -5175,16 +4894,13 @@ class Index(_BaseIndex):
5175
4894
  """Get stats of the index.
5176
4895
 
5177
4896
  Returns:
5178
-
5179
4897
  Stats of the index.
5180
4898
 
5181
4899
  Raises:
5182
-
5183
4900
  MeilisearchCommunicationError: If there was an error communicating with the server.
5184
4901
  MeilisearchApiError: If the Meilisearch API returned an error.
5185
4902
 
5186
- Examples:
5187
-
4903
+ Examples
5188
4904
  >>> from meilisearch_python_sdk import Client
5189
4905
  >>> client = Client("http://localhost.com", "masterKey")
5190
4906
  >>> index = client.index("movies")
@@ -5226,7 +4942,6 @@ class Index(_BaseIndex):
5226
4942
  """Search the index.
5227
4943
 
5228
4944
  Args:
5229
-
5230
4945
  query: String containing the word(s) to search
5231
4946
  offset: Number of documents to skip. Defaults to 0.
5232
4947
  limit: Maximum number of documents returned. Defaults to 20.
@@ -5285,16 +5000,13 @@ class Index(_BaseIndex):
5285
5000
  Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
5286
5001
 
5287
5002
  Returns:
5288
-
5289
5003
  Results of the search
5290
5004
 
5291
5005
  Raises:
5292
-
5293
5006
  MeilisearchCommunicationError: If there was an error communicating with the server.
5294
5007
  MeilisearchApiError: If the Meilisearch API returned an error.
5295
5008
 
5296
- Examples:
5297
-
5009
+ Examples
5298
5010
  >>> from meilisearch_python_sdk import Client
5299
5011
  >>> client = Client("http://localhost.com", "masterKey")
5300
5012
  >>> index = client.index("movies")
@@ -5401,7 +5113,6 @@ class Index(_BaseIndex):
5401
5113
  """Search the index.
5402
5114
 
5403
5115
  Args:
5404
-
5405
5116
  query: String containing the word(s) to search
5406
5117
  facet_name: The name of the facet to search
5407
5118
  facet_query: The facet search value
@@ -5452,16 +5163,13 @@ class Index(_BaseIndex):
5452
5163
  Milisearch >= v1.10.0. Defaults to None letting the Meilisearch pick.
5453
5164
 
5454
5165
  Returns:
5455
-
5456
5166
  Results of the search
5457
5167
 
5458
5168
  Raises:
5459
-
5460
5169
  MeilisearchCommunicationError: If there was an error communicating with the server.
5461
5170
  MeilisearchApiError: If the Meilisearch API returned an error.
5462
5171
 
5463
- Examples:
5464
-
5172
+ Examples
5465
5173
  >>> from meilisearch_python_sdk import Client
5466
5174
  >>> client = Client("http://localhost.com", "masterKey")
5467
5175
  >>> index = client.index("movies")
@@ -5571,16 +5279,13 @@ class Index(_BaseIndex):
5571
5279
  to None.
5572
5280
 
5573
5281
  Returns:
5574
-
5575
5282
  Results of the search
5576
5283
 
5577
5284
  Raises:
5578
-
5579
5285
  MeilisearchCommunicationError: If there was an error communicating with the server.
5580
5286
  MeilisearchApiError: If the Meilisearch API returned an error.
5581
5287
 
5582
- Examples:
5583
-
5288
+ Examples
5584
5289
  >>> from meilisearch_python_sdk import Client
5585
5290
  >>> client = Client("http://localhost.com", "masterKey")
5586
5291
  >>> index = client.index("movies")
@@ -5610,20 +5315,16 @@ class Index(_BaseIndex):
5610
5315
  """Get one document with given document identifier.
5611
5316
 
5612
5317
  Args:
5613
-
5614
5318
  document_id: Unique identifier of the document.
5615
5319
 
5616
5320
  Returns:
5617
-
5618
5321
  The document information
5619
5322
 
5620
5323
  Raises:
5621
-
5622
5324
  MeilisearchCommunicationError: If there was an error communicating with the server.
5623
5325
  MeilisearchApiError: If the Meilisearch API returned an error.
5624
5326
 
5625
- Examples:
5626
-
5327
+ Examples
5627
5328
  >>> from meilisearch_python_sdk import Client
5628
5329
  >>> client = Client("http://localhost.com", "masterKey")
5629
5330
  >>> index = client.index("movies")
@@ -5644,7 +5345,6 @@ class Index(_BaseIndex):
5644
5345
  """Get a batch documents from the index.
5645
5346
 
5646
5347
  Args:
5647
-
5648
5348
  offset: Number of documents to skip. Defaults to 0.
5649
5349
  limit: Maximum number of documents returnedd. Defaults to 20.
5650
5350
  fields: Document attributes to show. If this value is None then all
@@ -5653,17 +5353,14 @@ class Index(_BaseIndex):
5653
5353
  used with Meilisearch >= v1.2.0
5654
5354
 
5655
5355
  Returns:
5656
-
5657
5356
  Documents info.
5658
5357
 
5659
5358
  Raises:
5660
-
5661
5359
  MeilisearchCommunicationError: If there was an error communicating with the server.
5662
5360
  MeilisearchApiError: If the Meilisearch API returned an error.
5663
5361
 
5664
5362
 
5665
- Examples:
5666
-
5363
+ Examples
5667
5364
  >>> from meilisearch_python_sdk import Client
5668
5365
  >>> client = Client("http://localhost.com", "masterKey")
5669
5366
  >>> index = client.index("movies")
@@ -5701,23 +5398,19 @@ class Index(_BaseIndex):
5701
5398
  """Add documents to the index.
5702
5399
 
5703
5400
  Args:
5704
-
5705
5401
  documents: List of documents.
5706
5402
  primary_key: The primary key of the documents. This will be ignored if already set.
5707
5403
  Defaults to None.
5708
5404
  compress: If set to True the data will be sent in gzip format. Defaults to False.
5709
5405
 
5710
5406
  Returns:
5711
-
5712
5407
  The details of the task.
5713
5408
 
5714
5409
  Raises:
5715
-
5716
5410
  MeilisearchCommunicationError: If there was an error communicating with the server.
5717
5411
  MeilisearchApiError: If the Meilisearch API returned an error.
5718
5412
 
5719
- Examples:
5720
-
5413
+ Examples
5721
5414
  >>> from meilisearch_python_sdk import Client
5722
5415
  >>> documents = [
5723
5416
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -5762,7 +5455,6 @@ class Index(_BaseIndex):
5762
5455
  """Adds documents in batches to reduce RAM usage with indexing.
5763
5456
 
5764
5457
  Args:
5765
-
5766
5458
  documents: List of documents.
5767
5459
  batch_size: The number of documents that should be included in each batch.
5768
5460
  Defaults to 1000.
@@ -5771,16 +5463,13 @@ class Index(_BaseIndex):
5771
5463
  compress: If set to True the data will be sent in gzip format. Defaults to False.
5772
5464
 
5773
5465
  Returns:
5774
-
5775
5466
  List of update ids to track the action.
5776
5467
 
5777
5468
  Raises:
5778
-
5779
5469
  MeilisearchCommunicationError: If there was an error communicating with the server.
5780
5470
  MeilisearchApiError: If the Meilisearch API returned an error.
5781
5471
 
5782
- Examples:
5783
-
5472
+ Examples
5784
5473
  >>> from meilisearch_python_sdk import Client
5785
5474
  >>> >>> documents = [
5786
5475
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -5808,7 +5497,6 @@ class Index(_BaseIndex):
5808
5497
  """Load all json files from a directory and add the documents to the index.
5809
5498
 
5810
5499
  Args:
5811
-
5812
5500
  directory_path: Path to the directory that contains the json files.
5813
5501
  primary_key: The primary key of the documents. This will be ignored if already set.
5814
5502
  Defaults to None.
@@ -5822,18 +5510,15 @@ class Index(_BaseIndex):
5822
5510
  compress: If set to True the data will be sent in gzip format. Defaults to False.
5823
5511
 
5824
5512
  Returns:
5825
-
5826
5513
  The details of the task status.
5827
5514
 
5828
5515
  Raises:
5829
-
5830
5516
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
5831
5517
  MeilisearchError: If the file path is not valid
5832
5518
  MeilisearchCommunicationError: If there was an error communicating with the server.
5833
5519
  MeilisearchApiError: If the Meilisearch API returned an error.
5834
5520
 
5835
- Examples:
5836
-
5521
+ Examples
5837
5522
  >>> from pathlib import Path
5838
5523
  >>> from meilisearch_python_sdk import Client
5839
5524
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -5886,7 +5571,6 @@ class Index(_BaseIndex):
5886
5571
  """Load all json files from a directory and add the documents to the index in batches.
5887
5572
 
5888
5573
  Args:
5889
-
5890
5574
  directory_path: Path to the directory that contains the json files.
5891
5575
  batch_size: The number of documents that should be included in each batch.
5892
5576
  Defaults to 1000.
@@ -5902,18 +5586,15 @@ class Index(_BaseIndex):
5902
5586
  compress: If set to True the data will be sent in gzip format. Defaults to False.
5903
5587
 
5904
5588
  Returns:
5905
-
5906
5589
  List of update ids to track the action.
5907
5590
 
5908
5591
  Raises:
5909
-
5910
5592
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
5911
5593
  MeilisearchError: If the file path is not valid
5912
5594
  MeilisearchCommunicationError: If there was an error communicating with the server.
5913
5595
  MeilisearchApiError: If the Meilisearch API returned an error.
5914
5596
 
5915
- Examples:
5916
-
5597
+ Examples
5917
5598
  >>> from pathlib import Path
5918
5599
  >>> from meilisearch_python_sdk import Client
5919
5600
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -5972,25 +5653,21 @@ class Index(_BaseIndex):
5972
5653
  """Add documents to the index from a json file.
5973
5654
 
5974
5655
  Args:
5975
-
5976
5656
  file_path: Path to the json file.
5977
5657
  primary_key: The primary key of the documents. This will be ignored if already set.
5978
5658
  Defaults to None.
5979
5659
  compress: If set to True the data will be sent in gzip format. Defaults to False.
5980
5660
 
5981
5661
  Returns:
5982
-
5983
5662
  The details of the task status.
5984
5663
 
5985
5664
  Raises:
5986
-
5987
5665
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
5988
5666
  MeilisearchError: If the file path is not valid
5989
5667
  MeilisearchCommunicationError: If there was an error communicating with the server.
5990
5668
  MeilisearchApiError: If the Meilisearch API returned an error.
5991
5669
 
5992
- Examples:
5993
-
5670
+ Examples
5994
5671
  >>> from pathlib import Path
5995
5672
  >>> from meilisearch_python_sdk import Client
5996
5673
  >>> file_path = Path("/path/to/file.json")
@@ -6014,7 +5691,6 @@ class Index(_BaseIndex):
6014
5691
  """Adds documents form a json file in batches to reduce RAM usage with indexing.
6015
5692
 
6016
5693
  Args:
6017
-
6018
5694
  file_path: Path to the json file.
6019
5695
  batch_size: The number of documents that should be included in each batch.
6020
5696
  Defaults to 1000.
@@ -6025,18 +5701,15 @@ class Index(_BaseIndex):
6025
5701
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6026
5702
 
6027
5703
  Returns:
6028
-
6029
5704
  List of update ids to track the action.
6030
5705
 
6031
5706
  Raises:
6032
-
6033
5707
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
6034
5708
  MeilisearchError: If the file path is not valid
6035
5709
  MeilisearchCommunicationError: If there was an error communicating with the server.
6036
5710
  MeilisearchApiError: If the Meilisearch API returned an error.
6037
5711
 
6038
- Examples:
6039
-
5712
+ Examples
6040
5713
  >>> from pathlib import Path
6041
5714
  >>> from meilisearch_python_sdk import Client
6042
5715
  >>> file_path = Path("/path/to/file.json")
@@ -6069,7 +5742,6 @@ class Index(_BaseIndex):
6069
5742
  for batching.
6070
5743
 
6071
5744
  Args:
6072
-
6073
5745
  file_path: The path to the file to send to Meilisearch. Only csv and ndjson files are
6074
5746
  allowed.
6075
5747
  primary_key: The primary key of the documents. This will be ignored if already set.
@@ -6079,19 +5751,16 @@ class Index(_BaseIndex):
6079
5751
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6080
5752
 
6081
5753
  Returns:
6082
-
6083
5754
  The details of the task.
6084
5755
 
6085
5756
  Raises:
6086
-
6087
5757
  ValueError: If the file is not a csv or ndjson file, or if a csv_delimiter is sent for
6088
5758
  a non-csv file.
6089
5759
  MeilisearchError: If the file path is not valid
6090
5760
  MeilisearchCommunicationError: If there was an error communicating with the server.
6091
5761
  MeilisearchApiError: If the Meilisearch API returned an error.
6092
5762
 
6093
- Examples:
6094
-
5763
+ Examples
6095
5764
  >>> from pathlib import Path
6096
5765
  >>> from meilisearch_python_sdk import Client
6097
5766
  >>> file_path = Path("/path/to/file.csv")
@@ -6149,23 +5818,19 @@ class Index(_BaseIndex):
6149
5818
  sending a PATCH request to /experimental-features with { "editDocumentsByFunction": true }.
6150
5819
 
6151
5820
  Args:
6152
-
6153
5821
  function: Rhai function to use to update the documents.
6154
5822
  context: Parameters to use in the function. Defaults to None.
6155
5823
  filter: Filter the documents before applying the function. Defaults to None.
6156
5824
 
6157
5825
  Returns:
6158
-
6159
5826
  The details of the task.
6160
5827
 
6161
5828
  Raises:
6162
-
6163
5829
  MeilisearchError: If the file path is not valid
6164
5830
  MeilisearchCommunicationError: If there was an error communicating with the server.
6165
5831
  MeilisearchApiError: If the Meilisearch API returned an error.
6166
5832
 
6167
- Examples:
6168
-
5833
+ Examples
6169
5834
  >>> from meilisearch_python_sdk import Client
6170
5835
  >>> client = Client("http://localhost.com", "masterKey")
6171
5836
  >>> index = client.index("movies")
@@ -6194,23 +5859,19 @@ class Index(_BaseIndex):
6194
5859
  """Update documents in the index.
6195
5860
 
6196
5861
  Args:
6197
-
6198
5862
  documents: List of documents.
6199
5863
  primary_key: The primary key of the documents. This will be ignored if already set.
6200
5864
  Defaults to None.
6201
5865
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6202
5866
 
6203
5867
  Returns:
6204
-
6205
5868
  The details of the task.
6206
5869
 
6207
5870
  Raises:
6208
-
6209
5871
  MeilisearchCommunicationError: If there was an error communicating with the server.
6210
5872
  MeilisearchApiError: If the Meilisearch API returned an error.
6211
5873
 
6212
- Examples:
6213
-
5874
+ Examples
6214
5875
  >>> from meilisearch_python_sdk import Client
6215
5876
  >>> documents = [
6216
5877
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -6259,7 +5920,6 @@ class Index(_BaseIndex):
6259
5920
  Each batch tries to fill the max_payload_size
6260
5921
 
6261
5922
  Args:
6262
-
6263
5923
  documents: List of documents.
6264
5924
  batch_size: The number of documents that should be included in each batch.
6265
5925
  Defaults to 1000.
@@ -6268,16 +5928,13 @@ class Index(_BaseIndex):
6268
5928
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6269
5929
 
6270
5930
  Returns:
6271
-
6272
5931
  List of update ids to track the action.
6273
5932
 
6274
5933
  Raises:
6275
-
6276
5934
  MeilisearchCommunicationError: If there was an error communicating with the server.
6277
5935
  MeilisearchApiError: If the Meilisearch API returned an error.
6278
5936
 
6279
- Examples:
6280
-
5937
+ Examples
6281
5938
  >>> from meilisearch_python_sdk import Client
6282
5939
  >>> documents = [
6283
5940
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -6305,7 +5962,6 @@ class Index(_BaseIndex):
6305
5962
  """Load all json files from a directory and update the documents.
6306
5963
 
6307
5964
  Args:
6308
-
6309
5965
  directory_path: Path to the directory that contains the json files.
6310
5966
  primary_key: The primary key of the documents. This will be ignored if already set.
6311
5967
  Defaults to None.
@@ -6319,18 +5975,15 @@ class Index(_BaseIndex):
6319
5975
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6320
5976
 
6321
5977
  Returns:
6322
-
6323
5978
  The details of the task status.
6324
5979
 
6325
5980
  Raises:
6326
-
6327
5981
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
6328
5982
  MeilisearchError: If the file path is not valid
6329
5983
  MeilisearchCommunicationError: If there was an error communicating with the server.
6330
5984
  MeilisearchApiError: If the Meilisearch API returned an error.
6331
5985
 
6332
- Examples:
6333
-
5986
+ Examples
6334
5987
  >>> from pathlib import Path
6335
5988
  >>> from meilisearch_python_sdk import Client
6336
5989
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -6382,7 +6035,6 @@ class Index(_BaseIndex):
6382
6035
  """Load all json files from a directory and update the documents.
6383
6036
 
6384
6037
  Args:
6385
-
6386
6038
  directory_path: Path to the directory that contains the json files.
6387
6039
  batch_size: The number of documents that should be included in each batch.
6388
6040
  Defaults to 1000.
@@ -6398,18 +6050,15 @@ class Index(_BaseIndex):
6398
6050
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6399
6051
 
6400
6052
  Returns:
6401
-
6402
6053
  List of update ids to track the action.
6403
6054
 
6404
6055
  Raises:
6405
-
6406
6056
  InvalidDocumentError: If the docucment is not a valid format for Meilisearch.
6407
6057
  MeilisearchError: If the file path is not valid
6408
6058
  MeilisearchCommunicationError: If there was an error communicating with the server.
6409
6059
  MeilisearchApiError: If the Meilisearch API returned an error.
6410
6060
 
6411
- Examples:
6412
-
6061
+ Examples
6413
6062
  >>> from pathlib import Path
6414
6063
  >>> from meilisearch_python_sdk import Client
6415
6064
  >>> directory_path = Path("/path/to/directory/containing/files")
@@ -6470,7 +6119,6 @@ class Index(_BaseIndex):
6470
6119
  """Add documents in the index from a json file.
6471
6120
 
6472
6121
  Args:
6473
-
6474
6122
  file_path: Path to the json file.
6475
6123
  primary_key: The primary key of the documents. This will be ignored if already set.
6476
6124
  Defaults to None.
@@ -6479,16 +6127,13 @@ class Index(_BaseIndex):
6479
6127
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6480
6128
 
6481
6129
  Returns:
6482
-
6483
6130
  The details of the task status.
6484
6131
 
6485
6132
  Raises:
6486
-
6487
6133
  MeilisearchCommunicationError: If there was an error communicating with the server.
6488
6134
  MeilisearchApiError: If the Meilisearch API returned an error.
6489
6135
 
6490
- Examples:
6491
-
6136
+ Examples
6492
6137
  >>> from pathlib import Path
6493
6138
  >>> from meilisearch_python_sdk import Client
6494
6139
  >>> file_path = Path("/path/to/file.json")
@@ -6513,7 +6158,6 @@ class Index(_BaseIndex):
6513
6158
  """Updates documents form a json file in batches to reduce RAM usage with indexing.
6514
6159
 
6515
6160
  Args:
6516
-
6517
6161
  file_path: Path to the json file.
6518
6162
  batch_size: The number of documents that should be included in each batch.
6519
6163
  Defaults to 1000.
@@ -6522,16 +6166,13 @@ class Index(_BaseIndex):
6522
6166
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6523
6167
 
6524
6168
  Returns:
6525
-
6526
6169
  List of update ids to track the action.
6527
6170
 
6528
6171
  Raises:
6529
-
6530
6172
  MeilisearchCommunicationError: If there was an error communicating with the server.
6531
6173
  MeilisearchApiError: If the Meilisearch API returned an error.
6532
6174
 
6533
- Examples:
6534
-
6175
+ Examples
6535
6176
  >>> from pathlib import Path
6536
6177
  >>> from meilisearch_python_sdk import Client
6537
6178
  >>> file_path = Path("/path/to/file.json")
@@ -6562,7 +6203,6 @@ class Index(_BaseIndex):
6562
6203
  for batching.
6563
6204
 
6564
6205
  Args:
6565
-
6566
6206
  file_path: The path to the file to send to Meilisearch. Only csv and ndjson files are
6567
6207
  allowed.
6568
6208
  primary_key: The primary key of the documents. This will be ignored if already set.
@@ -6572,19 +6212,16 @@ class Index(_BaseIndex):
6572
6212
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6573
6213
 
6574
6214
  Returns:
6575
-
6576
6215
  The details of the task status.
6577
6216
 
6578
6217
  Raises:
6579
-
6580
6218
  ValueError: If the file is not a csv or ndjson file, or if a csv_delimiter is sent for
6581
6219
  a non-csv file.
6582
6220
  MeilisearchError: If the file path is not valid
6583
6221
  MeilisearchCommunicationError: If there was an error communicating with the server.
6584
6222
  MeilisearchApiError: If the Meilisearch API returned an error.
6585
6223
 
6586
- Examples:
6587
-
6224
+ Examples
6588
6225
  >>> from pathlib import Path
6589
6226
  >>> from meilisearch_python_sdk import Client
6590
6227
  >>> file_path = Path("/path/to/file.csv")
@@ -6636,20 +6273,16 @@ class Index(_BaseIndex):
6636
6273
  """Delete one document from the index.
6637
6274
 
6638
6275
  Args:
6639
-
6640
6276
  document_id: Unique identifier of the document.
6641
6277
 
6642
6278
  Returns:
6643
-
6644
6279
  The details of the task status.
6645
6280
 
6646
6281
  Raises:
6647
-
6648
6282
  MeilisearchCommunicationError: If there was an error communicating with the server.
6649
6283
  MeilisearchApiError: If the Meilisearch API returned an error.
6650
6284
 
6651
- Examples:
6652
-
6285
+ Examples
6653
6286
  >>> from meilisearch_python_sdk import Client
6654
6287
  >>> client = Client("http://localhost.com", "masterKey")
6655
6288
  >>> index = client.index("movies")
@@ -6673,20 +6306,16 @@ class Index(_BaseIndex):
6673
6306
  """Delete multiple documents from the index.
6674
6307
 
6675
6308
  Args:
6676
-
6677
6309
  ids: List of unique identifiers of documents.
6678
6310
 
6679
6311
  Returns:
6680
-
6681
6312
  List of update ids to track the action.
6682
6313
 
6683
6314
  Raises:
6684
-
6685
6315
  MeilisearchCommunicationError: If there was an error communicating with the server.
6686
6316
  MeilisearchApiError: If the Meilisearch API returned an error.
6687
6317
 
6688
- Examples:
6689
-
6318
+ Examples
6690
6319
  >>> from meilisearch_python_sdk import Client
6691
6320
  >>> client = Client("http://localhost.com", "masterKey")
6692
6321
  >>> index = client.index("movies")
@@ -6710,20 +6339,16 @@ class Index(_BaseIndex):
6710
6339
  """Delete documents from the index by filter.
6711
6340
 
6712
6341
  Args:
6713
-
6714
6342
  filter: The filter value information.
6715
6343
 
6716
6344
  Returns:
6717
-
6718
6345
  The details of the task status.
6719
6346
 
6720
6347
  Raises:
6721
-
6722
6348
  MeilisearchCommunicationError: If there was an error communicating with the server.
6723
6349
  MeilisearchApiError: If the Meilisearch API returned an error.
6724
6350
 
6725
- Examples:
6726
-
6351
+ Examples
6727
6352
  >>> from meilisearch_python_sdk import Client
6728
6353
  >>> client = Client("http://localhost.com", "masterKey")
6729
6354
  >>> index = client.index("movies")
@@ -6753,20 +6378,16 @@ class Index(_BaseIndex):
6753
6378
  """Delete batches of documents from the index by filter.
6754
6379
 
6755
6380
  Args:
6756
-
6757
6381
  filters: A list of filter value information.
6758
6382
 
6759
6383
  Returns:
6760
-
6761
6384
  The a list of details of the task statuses.
6762
6385
 
6763
6386
  Raises:
6764
-
6765
6387
  MeilisearchCommunicationError: If there was an error communicating with the server.
6766
6388
  MeilisearchApiError: If the Meilisearch API returned an error.
6767
6389
 
6768
- Examples:
6769
-
6390
+ Examples
6770
6391
  >>> from meilisearch_python_sdk import Client
6771
6392
  >>> client = Client("http://localhost.com", "masterKey")
6772
6393
  >>> index = client.index("movies")
@@ -6783,16 +6404,13 @@ class Index(_BaseIndex):
6783
6404
  """Delete all documents from the index.
6784
6405
 
6785
6406
  Returns:
6786
-
6787
6407
  The details of the task status.
6788
6408
 
6789
6409
  Raises:
6790
-
6791
6410
  MeilisearchCommunicationError: If there was an error communicating with the server.
6792
6411
  MeilisearchApiError: If the Meilisearch API returned an error.
6793
6412
 
6794
- Examples:
6795
-
6413
+ Examples
6796
6414
  >>> from meilisearch_python_sdk import Client
6797
6415
  >>> client = Client("http://localhost.com", "masterKey")
6798
6416
  >>> index = client.index("movies")
@@ -6816,16 +6434,13 @@ class Index(_BaseIndex):
6816
6434
  """Get settings of the index.
6817
6435
 
6818
6436
  Returns:
6819
-
6820
6437
  Settings of the index.
6821
6438
 
6822
6439
  Raises:
6823
-
6824
6440
  MeilisearchCommunicationError: If there was an error communicating with the server.
6825
6441
  MeilisearchApiError: If the Meilisearch API returned an error.
6826
6442
 
6827
- Examples:
6828
-
6443
+ Examples
6829
6444
  >>> from meilisearch_python_sdk import Client
6830
6445
  >>> client = Client("http://localhost.com", "masterKey")
6831
6446
  >>> index = client.index("movies")
@@ -6847,21 +6462,17 @@ class Index(_BaseIndex):
6847
6462
  """Update settings of the index.
6848
6463
 
6849
6464
  Args:
6850
-
6851
6465
  body: Settings of the index.
6852
6466
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6853
6467
 
6854
6468
  Returns:
6855
-
6856
6469
  The details of the task status.
6857
6470
 
6858
6471
  Raises:
6859
-
6860
6472
  MeilisearchCommunicationError: If there was an error communicating with the server.
6861
6473
  MeilisearchApiError: If the Meilisearch API returned an error.
6862
6474
 
6863
- Examples:
6864
-
6475
+ Examples
6865
6476
  >>> from meilisearch_python_sdk import Client
6866
6477
  >>> from meilisearch_python_sdk import MeilisearchSettings
6867
6478
  >>> new_settings = MeilisearchSettings(
@@ -6896,16 +6507,13 @@ class Index(_BaseIndex):
6896
6507
  """Reset settings of the index to default values.
6897
6508
 
6898
6509
  Returns:
6899
-
6900
6510
  The details of the task status.
6901
6511
 
6902
6512
  Raises:
6903
-
6904
6513
  MeilisearchCommunicationError: If there was an error communicating with the server.
6905
6514
  MeilisearchApiError: If the Meilisearch API returned an error.
6906
6515
 
6907
- Examples:
6908
-
6516
+ Examples
6909
6517
  >>> from meilisearch_python_sdk import Client
6910
6518
  >>> client = Client("http://localhost.com", "masterKey")
6911
6519
  >>> index = client.index("movies")
@@ -6919,16 +6527,13 @@ class Index(_BaseIndex):
6919
6527
  """Get ranking rules of the index.
6920
6528
 
6921
6529
  Returns:
6922
-
6923
6530
  List containing the ranking rules of the index.
6924
6531
 
6925
6532
  Raises:
6926
-
6927
6533
  MeilisearchCommunicationError: If there was an error communicating with the server.
6928
6534
  MeilisearchApiError: If the Meilisearch API returned an error.
6929
6535
 
6930
- Examples:
6931
-
6536
+ Examples
6932
6537
  >>> from meilisearch_python_sdk import Client
6933
6538
  >>> client = Client("http://localhost.com", "masterKey")
6934
6539
  >>> index = client.index("movies")
@@ -6942,21 +6547,17 @@ class Index(_BaseIndex):
6942
6547
  """Update ranking rules of the index.
6943
6548
 
6944
6549
  Args:
6945
-
6946
6550
  ranking_rules: List containing the ranking rules.
6947
6551
  compress: If set to True the data will be sent in gzip format. Defaults to False.
6948
6552
 
6949
6553
  Returns:
6950
-
6951
6554
  The details of the task status.
6952
6555
 
6953
6556
  Raises:
6954
-
6955
6557
  MeilisearchCommunicationError: If there was an error communicating with the server.
6956
6558
  MeilisearchApiError: If the Meilisearch API returned an error.
6957
6559
 
6958
- Examples:
6959
-
6560
+ Examples
6960
6561
  >>> from meilisearch_python_sdk import Client
6961
6562
  >>> ranking_rules=[
6962
6563
  >>> "words",
@@ -6982,16 +6583,13 @@ class Index(_BaseIndex):
6982
6583
  """Reset ranking rules of the index to default values.
6983
6584
 
6984
6585
  Returns:
6985
-
6986
6586
  The details of the task status.
6987
6587
 
6988
6588
  Raises:
6989
-
6990
6589
  MeilisearchCommunicationError: If there was an error communicating with the server.
6991
6590
  MeilisearchApiError: If the Meilisearch API returned an error.
6992
6591
 
6993
- Examples:
6994
-
6592
+ Examples
6995
6593
  >>> from meilisearch_python_sdk import Client
6996
6594
  >>> client = Client("http://localhost.com", "masterKey")
6997
6595
  >>> index = client.index("movies")
@@ -7005,17 +6603,14 @@ class Index(_BaseIndex):
7005
6603
  """Get distinct attribute of the index.
7006
6604
 
7007
6605
  Returns:
7008
-
7009
6606
  String containing the distinct attribute of the index. If no distinct attribute
7010
6607
  `None` is returned.
7011
6608
 
7012
6609
  Raises:
7013
-
7014
6610
  MeilisearchCommunicationError: If there was an error communicating with the server.
7015
6611
  MeilisearchApiError: If the Meilisearch API returned an error.
7016
6612
 
7017
- Examples:
7018
-
6613
+ Examples
7019
6614
  >>> from meilisearch_python_sdk import Client
7020
6615
  >>> client = Client("http://localhost.com", "masterKey")
7021
6616
  >>> index = client.index("movies")
@@ -7032,21 +6627,17 @@ class Index(_BaseIndex):
7032
6627
  """Update distinct attribute of the index.
7033
6628
 
7034
6629
  Args:
7035
-
7036
6630
  body: Distinct attribute.
7037
6631
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7038
6632
 
7039
6633
  Returns:
7040
-
7041
6634
  The details of the task status.
7042
6635
 
7043
6636
  Raises:
7044
-
7045
6637
  MeilisearchCommunicationError: If there was an error communicating with the server.
7046
6638
  MeilisearchApiError: If the Meilisearch API returned an error.
7047
6639
 
7048
- Examples:
7049
-
6640
+ Examples
7050
6641
  >>> from meilisearch_python_sdk import Client
7051
6642
  >>> client = Client("http://localhost.com", "masterKey")
7052
6643
  >>> index = client.index("movies")
@@ -7062,16 +6653,13 @@ class Index(_BaseIndex):
7062
6653
  """Reset distinct attribute of the index to default values.
7063
6654
 
7064
6655
  Returns:
7065
-
7066
6656
  The details of the task status.
7067
6657
 
7068
6658
  Raises:
7069
-
7070
6659
  MeilisearchCommunicationError: If there was an error communicating with the server.
7071
6660
  MeilisearchApiError: If the Meilisearch API returned an error.
7072
6661
 
7073
- Examples:
7074
-
6662
+ Examples
7075
6663
  >>> from meilisearch_python_sdk import Client
7076
6664
  >>> client = Client("http://localhost.com", "masterKey")
7077
6665
  >>> index = client.index("movies")
@@ -7085,16 +6673,13 @@ class Index(_BaseIndex):
7085
6673
  """Get searchable attributes of the index.
7086
6674
 
7087
6675
  Returns:
7088
-
7089
6676
  List containing the searchable attributes of the index.
7090
6677
 
7091
6678
  Raises:
7092
-
7093
6679
  MeilisearchCommunicationError: If there was an error communicating with the server.
7094
6680
  MeilisearchApiError: If the Meilisearch API returned an error.
7095
6681
 
7096
- Examples:
7097
-
6682
+ Examples
7098
6683
  >>> from meilisearch_python_sdk import Client
7099
6684
  >>> client = Client("http://localhost.com", "masterKey")
7100
6685
  >>> index = client.index("movies")
@@ -7108,21 +6693,17 @@ class Index(_BaseIndex):
7108
6693
  """Update searchable attributes of the index.
7109
6694
 
7110
6695
  Args:
7111
-
7112
6696
  body: List containing the searchable attributes.
7113
6697
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7114
6698
 
7115
6699
  Returns:
7116
-
7117
6700
  The details of the task status.
7118
6701
 
7119
6702
  Raises:
7120
-
7121
6703
  MeilisearchCommunicationError: If there was an error communicating with the server.
7122
6704
  MeilisearchApiError: If the Meilisearch API returned an error.
7123
6705
 
7124
- Examples:
7125
-
6706
+ Examples
7126
6707
  >>> from meilisearch_python_sdk import Client
7127
6708
  >>> client = Client("http://localhost.com", "masterKey")
7128
6709
  >>> index = client.index("movies")
@@ -7138,16 +6719,13 @@ class Index(_BaseIndex):
7138
6719
  """Reset searchable attributes of the index to default values.
7139
6720
 
7140
6721
  Returns:
7141
-
7142
6722
  The details of the task status.
7143
6723
 
7144
6724
  Raises:
7145
-
7146
6725
  MeilisearchCommunicationError: If there was an error communicating with the server.
7147
6726
  MeilisearchApiError: If the Meilisearch API returned an error.
7148
6727
 
7149
- Examples:
7150
-
6728
+ Examples
7151
6729
  >>> from meilisearch_python_sdk import Client
7152
6730
  >>> client = Client("http://localhost.com", "masterKey")
7153
6731
  >>> index = client.index("movies")
@@ -7161,16 +6739,13 @@ class Index(_BaseIndex):
7161
6739
  """Get displayed attributes of the index.
7162
6740
 
7163
6741
  Returns:
7164
-
7165
6742
  List containing the displayed attributes of the index.
7166
6743
 
7167
6744
  Raises:
7168
-
7169
6745
  MeilisearchCommunicationError: If there was an error communicating with the server.
7170
6746
  MeilisearchApiError: If the Meilisearch API returned an error.
7171
6747
 
7172
- Examples:
7173
-
6748
+ Examples
7174
6749
  >>> from meilisearch_python_sdk import Client
7175
6750
  >>> client = Client("http://localhost.com", "masterKey")
7176
6751
  >>> index = client.index("movies")
@@ -7184,21 +6759,17 @@ class Index(_BaseIndex):
7184
6759
  """Update displayed attributes of the index.
7185
6760
 
7186
6761
  Args:
7187
-
7188
6762
  body: List containing the displayed attributes.
7189
6763
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7190
6764
 
7191
6765
  Returns:
7192
-
7193
6766
  The details of the task status.
7194
6767
 
7195
6768
  Raises:
7196
-
7197
6769
  MeilisearchCommunicationError: If there was an error communicating with the server.
7198
6770
  MeilisearchApiError: If the Meilisearch API returned an error.
7199
6771
 
7200
- Examples:
7201
-
6772
+ Examples
7202
6773
  >>> from meilisearch_python_sdk import Client
7203
6774
  >>> client = Client("http://localhost.com", "masterKey")
7204
6775
  >>> index = client.index("movies")
@@ -7216,16 +6787,13 @@ class Index(_BaseIndex):
7216
6787
  """Reset displayed attributes of the index to default values.
7217
6788
 
7218
6789
  Returns:
7219
-
7220
6790
  The details of the task status.
7221
6791
 
7222
6792
  Raises:
7223
-
7224
6793
  MeilisearchCommunicationError: If there was an error communicating with the server.
7225
6794
  MeilisearchApiError: If the Meilisearch API returned an error.
7226
6795
 
7227
- Examples:
7228
-
6796
+ Examples
7229
6797
  >>> from meilisearch_python_sdk import Client
7230
6798
  >>> client = Client("http://localhost.com", "masterKey")
7231
6799
  >>> index = client.index("movies")
@@ -7239,16 +6807,13 @@ class Index(_BaseIndex):
7239
6807
  """Get stop words of the index.
7240
6808
 
7241
6809
  Returns:
7242
-
7243
6810
  List containing the stop words of the index.
7244
6811
 
7245
6812
  Raises:
7246
-
7247
6813
  MeilisearchCommunicationError: If there was an error communicating with the server.
7248
6814
  MeilisearchApiError: If the Meilisearch API returned an error.
7249
6815
 
7250
- Examples:
7251
-
6816
+ Examples
7252
6817
  >>> from meilisearch_python_sdk import Client
7253
6818
  >>> client = Client("http://localhost.com", "masterKey")
7254
6819
  >>> index = client.index("movies")
@@ -7265,21 +6830,17 @@ class Index(_BaseIndex):
7265
6830
  """Update stop words of the index.
7266
6831
 
7267
6832
  Args:
7268
-
7269
6833
  body: List containing the stop words of the index.
7270
6834
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7271
6835
 
7272
6836
  Returns:
7273
-
7274
6837
  The details of the task status.
7275
6838
 
7276
6839
  Raises:
7277
-
7278
6840
  MeilisearchCommunicationError: If there was an error communicating with the server.
7279
6841
  MeilisearchApiError: If the Meilisearch API returned an error.
7280
6842
 
7281
- Examples:
7282
-
6843
+ Examples
7283
6844
  >>> from meilisearch_python_sdk import Client
7284
6845
  >>> client = Client("http://localhost.com", "masterKey")
7285
6846
  >>> index = client.index("movies")
@@ -7295,16 +6856,13 @@ class Index(_BaseIndex):
7295
6856
  """Reset stop words of the index to default values.
7296
6857
 
7297
6858
  Returns:
7298
-
7299
6859
  The details of the task status.
7300
6860
 
7301
6861
  Raises:
7302
-
7303
6862
  MeilisearchCommunicationError: If there was an error communicating with the server.
7304
6863
  MeilisearchApiError: If the Meilisearch API returned an error.
7305
6864
 
7306
- Examples:
7307
-
6865
+ Examples
7308
6866
  >>> from meilisearch_python_sdk import Client
7309
6867
  >>> client = Client("http://localhost.com", "masterKey")
7310
6868
  >>> index = client.index("movies")
@@ -7318,16 +6876,13 @@ class Index(_BaseIndex):
7318
6876
  """Get synonyms of the index.
7319
6877
 
7320
6878
  Returns:
7321
-
7322
6879
  The synonyms of the index.
7323
6880
 
7324
6881
  Raises:
7325
-
7326
6882
  MeilisearchCommunicationError: If there was an error communicating with the server.
7327
6883
  MeilisearchApiError: If the Meilisearch API returned an error.
7328
6884
 
7329
- Examples:
7330
-
6885
+ Examples
7331
6886
  >>> from meilisearch_python_sdk import Client
7332
6887
  >>> client = Client("http://localhost.com", "masterKey")
7333
6888
  >>> index = client.index("movies")
@@ -7344,20 +6899,16 @@ class Index(_BaseIndex):
7344
6899
  """Update synonyms of the index.
7345
6900
 
7346
6901
  Args:
7347
-
7348
6902
  body: The synonyms of the index.
7349
6903
 
7350
6904
  Returns:
7351
-
7352
6905
  The details of the task status.
7353
6906
 
7354
6907
  Raises:
7355
-
7356
6908
  MeilisearchCommunicationError: If there was an error communicating with the server.
7357
6909
  MeilisearchApiError: If the Meilisearch API returned an error.
7358
6910
 
7359
- Examples:
7360
-
6911
+ Examples
7361
6912
  >>> from meilisearch_python_sdk import Client
7362
6913
  >>> client = Client("http://localhost.com", "masterKey") as client:
7363
6914
  >>> index = client.index("movies")
@@ -7375,16 +6926,13 @@ class Index(_BaseIndex):
7375
6926
  """Reset synonyms of the index to default values.
7376
6927
 
7377
6928
  Returns:
7378
-
7379
6929
  The details of the task status.
7380
6930
 
7381
6931
  Raises:
7382
-
7383
6932
  MeilisearchCommunicationError: If there was an error communicating with the server.
7384
6933
  MeilisearchApiError: If the Meilisearch API returned an error.
7385
6934
 
7386
- Examples:
7387
-
6935
+ Examples
7388
6936
  >>> from meilisearch_python_sdk import Client
7389
6937
  >>> client = Client("http://localhost.com", "masterKey")
7390
6938
  >>> index = client.index("movies")
@@ -7398,16 +6946,13 @@ class Index(_BaseIndex):
7398
6946
  """Get filterable attributes of the index.
7399
6947
 
7400
6948
  Returns:
7401
-
7402
6949
  List containing the filterable attributes of the index.
7403
6950
 
7404
6951
  Raises:
7405
-
7406
6952
  MeilisearchCommunicationError: If there was an error communicating with the server.
7407
6953
  MeilisearchApiError: If the Meilisearch API returned an error.
7408
6954
 
7409
- Examples:
7410
-
6955
+ Examples
7411
6956
  >>> from meilisearch_python_sdk import Client
7412
6957
  >>> client = Client("http://localhost.com", "masterKey")
7413
6958
  >>> index = client.index("movies")
@@ -7424,21 +6969,17 @@ class Index(_BaseIndex):
7424
6969
  """Update filterable attributes of the index.
7425
6970
 
7426
6971
  Args:
7427
-
7428
6972
  body: List containing the filterable attributes of the index.
7429
6973
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7430
6974
 
7431
6975
  Returns:
7432
-
7433
6976
  The details of the task status.
7434
6977
 
7435
6978
  Raises:
7436
-
7437
6979
  MeilisearchCommunicationError: If there was an error communicating with the server.
7438
6980
  MeilisearchApiError: If the Meilisearch API returned an error.
7439
6981
 
7440
- Examples:
7441
-
6982
+ Examples
7442
6983
  >>> from meilisearch_python_sdk import Client
7443
6984
  >>> client = Client("http://localhost.com", "masterKey")
7444
6985
  >>> index = client.index("movies")
@@ -7454,16 +6995,13 @@ class Index(_BaseIndex):
7454
6995
  """Reset filterable attributes of the index to default values.
7455
6996
 
7456
6997
  Returns:
7457
-
7458
6998
  The details of the task status.
7459
6999
 
7460
7000
  Raises:
7461
-
7462
7001
  MeilisearchCommunicationError: If there was an error communicating with the server.
7463
7002
  MeilisearchApiError: If the Meilisearch API returned an error.
7464
7003
 
7465
- Examples:
7466
-
7004
+ Examples
7467
7005
  >>> from meilisearch_python_sdk import Client
7468
7006
  >>> client = Client("http://localhost.com", "masterKey")
7469
7007
  >>> index = client.index("movies")
@@ -7477,16 +7015,13 @@ class Index(_BaseIndex):
7477
7015
  """Get sortable attributes of the AsyncIndex.
7478
7016
 
7479
7017
  Returns:
7480
-
7481
7018
  List containing the sortable attributes of the AsyncIndex.
7482
7019
 
7483
7020
  Raises:
7484
-
7485
7021
  MeilisearchCommunicationError: If there was an error communicating with the server.
7486
7022
  MeilisearchApiError: If the Meilisearch API returned an error.
7487
7023
 
7488
- Examples:
7489
-
7024
+ Examples
7490
7025
  >>> from meilisearch_python_sdk import Client
7491
7026
  >>> client = Client("http://localhost.com", "masterKey")
7492
7027
  >>> index = client.index("movies")
@@ -7502,21 +7037,17 @@ class Index(_BaseIndex):
7502
7037
  """Get sortable attributes of the AsyncIndex.
7503
7038
 
7504
7039
  Args:
7505
-
7506
7040
  sortable_attributes: List of attributes for searching.
7507
7041
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7508
7042
 
7509
7043
  Returns:
7510
-
7511
7044
  The details of the task status.
7512
7045
 
7513
7046
  Raises:
7514
-
7515
7047
  MeilisearchCommunicationError: If there was an error communicating with the server.
7516
7048
  MeilisearchApiError: If the Meilisearch API returned an error.
7517
7049
 
7518
- Examples:
7519
-
7050
+ Examples
7520
7051
  >>> from meilisearch_python_sdk import Client
7521
7052
  >>> client = Client("http://localhost.com", "masterKey")
7522
7053
  >>> index = client.index("movies")
@@ -7532,16 +7063,13 @@ class Index(_BaseIndex):
7532
7063
  """Reset sortable attributes of the index to default values.
7533
7064
 
7534
7065
  Returns:
7535
-
7536
7066
  The details of the task status.
7537
7067
 
7538
7068
  Raises:
7539
-
7540
7069
  MeilisearchCommunicationError: If there was an error communicating with the server.
7541
7070
  MeilisearchApiError: If the Meilisearch API returned an error.
7542
7071
 
7543
- Examples:
7544
-
7072
+ Examples
7545
7073
  >>> from meilisearch_python_sdk import Client
7546
7074
  >>> client = Client("http://localhost.com", "masterKey")
7547
7075
  >>> index = client.index("movies")
@@ -7555,16 +7083,13 @@ class Index(_BaseIndex):
7555
7083
  """Get typo tolerance for the index.
7556
7084
 
7557
7085
  Returns:
7558
-
7559
7086
  TypoTolerance for the index.
7560
7087
 
7561
7088
  Raises:
7562
-
7563
7089
  MeilisearchCommunicationError: If there was an error communicating with the server.
7564
7090
  MeilisearchApiError: If the Meilisearch API returned an error.
7565
7091
 
7566
- Examples:
7567
-
7092
+ Examples
7568
7093
  >>> from meilisearch_python_sdk import Client
7569
7094
  >>> client = Client("http://localhost.com", "masterKey")
7570
7095
  >>> index = client.index("movies")
@@ -7580,21 +7105,17 @@ class Index(_BaseIndex):
7580
7105
  """Update typo tolerance.
7581
7106
 
7582
7107
  Args:
7583
-
7584
7108
  typo_tolerance: Typo tolerance settings.
7585
7109
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7586
7110
 
7587
7111
  Returns:
7588
-
7589
7112
  Task to track the action.
7590
7113
 
7591
7114
  Raises:
7592
-
7593
7115
  MeilisearchCommunicationError: If there was an error communicating with the server.
7594
7116
  MeilisearchApiError: If the Meilisearch API returned an error.
7595
7117
 
7596
- Examples:
7597
-
7118
+ Examples
7598
7119
  >>> from meilisearch_python_sdk import Client
7599
7120
  >>> client = Client("http://localhost.com", "masterKey")
7600
7121
  >>> index = client.index("movies")
@@ -7613,16 +7134,13 @@ class Index(_BaseIndex):
7613
7134
  """Reset typo tolerance to default values.
7614
7135
 
7615
7136
  Returns:
7616
-
7617
7137
  The details of the task status.
7618
7138
 
7619
7139
  Raises:
7620
-
7621
7140
  MeilisearchCommunicationError: If there was an error communicating with the server.
7622
7141
  MeilisearchApiError: If the Meilisearch API returned an error.
7623
7142
 
7624
- Examples:
7625
-
7143
+ Examples
7626
7144
  >>> from meilisearch_python_sdk import Client
7627
7145
  >>> client = Client("http://localhost.com", "masterKey")
7628
7146
  >>> index = client.index("movies")
@@ -7636,16 +7154,13 @@ class Index(_BaseIndex):
7636
7154
  """Get faceting for the index.
7637
7155
 
7638
7156
  Returns:
7639
-
7640
7157
  Faceting for the index.
7641
7158
 
7642
7159
  Raises:
7643
-
7644
7160
  MeilisearchCommunicationError: If there was an error communicating with the server.
7645
7161
  MeilisearchApiError: If the Meilisearch API returned an error.
7646
7162
 
7647
- Examples:
7648
-
7163
+ Examples
7649
7164
  >>> from meilisearch_python_sdk import Client
7650
7165
  >>> client = Client("http://localhost.com", "masterKey")
7651
7166
  >>> index = client.index("movies")
@@ -7659,21 +7174,17 @@ class Index(_BaseIndex):
7659
7174
  """Partially update the faceting settings for an index.
7660
7175
 
7661
7176
  Args:
7662
-
7663
7177
  faceting: Faceting values.
7664
7178
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7665
7179
 
7666
7180
  Returns:
7667
-
7668
7181
  Task to track the action.
7669
7182
 
7670
7183
  Raises:
7671
-
7672
7184
  MeilisearchCommunicationError: If there was an error communicating with the server.
7673
7185
  MeilisearchApiError: If the Meilisearch API returned an error.
7674
7186
 
7675
- Examples:
7676
-
7187
+ Examples
7677
7188
  >>> from meilisearch_python_sdk import Client
7678
7189
  >>> client = Client("http://localhost.com", "masterKey")
7679
7190
  >>> index = client.index("movies")
@@ -7691,16 +7202,13 @@ class Index(_BaseIndex):
7691
7202
  """Reset an index's faceting settings to their default value.
7692
7203
 
7693
7204
  Returns:
7694
-
7695
7205
  The details of the task status.
7696
7206
 
7697
7207
  Raises:
7698
-
7699
7208
  MeilisearchCommunicationError: If there was an error communicating with the server.
7700
7209
  MeilisearchApiError: If the Meilisearch API returned an error.
7701
7210
 
7702
- Examples:
7703
-
7211
+ Examples
7704
7212
  >>> from meilisearch_python_sdk import Client
7705
7213
  >>> client = Client("http://localhost.com", "masterKey")
7706
7214
  >>> index = client.index("movies")
@@ -7714,16 +7222,13 @@ class Index(_BaseIndex):
7714
7222
  """Get pagination settings for the index.
7715
7223
 
7716
7224
  Returns:
7717
-
7718
7225
  Pagination for the index.
7719
7226
 
7720
7227
  Raises:
7721
-
7722
7228
  MeilisearchCommunicationError: If there was an error communicating with the server.
7723
7229
  MeilisearchApiError: If the Meilisearch API returned an error.
7724
7230
 
7725
- Examples:
7726
-
7231
+ Examples
7727
7232
  >>> from meilisearch_async_client import Client
7728
7233
  >>> client = Client("http://localhost.com", "masterKey")
7729
7234
  >>> index = client.index("movies")
@@ -7737,21 +7242,17 @@ class Index(_BaseIndex):
7737
7242
  """Partially update the pagination settings for an index.
7738
7243
 
7739
7244
  Args:
7740
-
7741
7245
  settings: settings for pagination.
7742
7246
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7743
7247
 
7744
7248
  Returns:
7745
-
7746
7249
  Task to track the action.
7747
7250
 
7748
7251
  Raises:
7749
-
7750
7252
  MeilisearchCommunicationError: If there was an error communicating with the server.
7751
7253
  MeilisearchApiError: If the Meilisearch API returned an error.
7752
7254
 
7753
- Examples:
7754
-
7255
+ Examples
7755
7256
  >>> from meilisearch_python_sdk import Client
7756
7257
  >>> from meilisearch_python_sdk.models.settings import Pagination
7757
7258
  >>> client = Client("http://localhost.com", "masterKey")
@@ -7770,16 +7271,13 @@ class Index(_BaseIndex):
7770
7271
  """Reset an index's pagination settings to their default value.
7771
7272
 
7772
7273
  Returns:
7773
-
7774
7274
  The details of the task status.
7775
7275
 
7776
7276
  Raises:
7777
-
7778
7277
  MeilisearchCommunicationError: If there was an error communicating with the server.
7779
7278
  MeilisearchApiError: If the Meilisearch API returned an error.
7780
7279
 
7781
- Examples:
7782
-
7280
+ Examples
7783
7281
  >>> from meilisearch_async_client import Client
7784
7282
  >>> client = Client("http://localhost.com", "masterKey")
7785
7283
  >>> index = client.index("movies")
@@ -7793,16 +7291,13 @@ class Index(_BaseIndex):
7793
7291
  """Get separator token settings for the index.
7794
7292
 
7795
7293
  Returns:
7796
-
7797
7294
  Separator tokens for the index.
7798
7295
 
7799
7296
  Raises:
7800
-
7801
7297
  MeilisearchCommunicationError: If there was an error communicating with the server.
7802
7298
  MeilisearchApiError: If the Meilisearch API returned an error.
7803
7299
 
7804
- Examples:
7805
-
7300
+ Examples
7806
7301
  >>> from meilisearch_async_client import Client
7807
7302
  >>> client = Client("http://localhost.com", "masterKey")
7808
7303
  >>> index = client.index("movies")
@@ -7818,21 +7313,17 @@ class Index(_BaseIndex):
7818
7313
  """Update the separator tokens settings for an index.
7819
7314
 
7820
7315
  Args:
7821
-
7822
7316
  separator_tokens: List of separator tokens.
7823
7317
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7824
7318
 
7825
7319
  Returns:
7826
-
7827
7320
  Task to track the action.
7828
7321
 
7829
7322
  Raises:
7830
-
7831
7323
  MeilisearchCommunicationError: If there was an error communicating with the server.
7832
7324
  MeilisearchApiError: If the Meilisearch API returned an error.
7833
7325
 
7834
- Examples:
7835
-
7326
+ Examples
7836
7327
  >>> from meilisearch_python_sdk import Client
7837
7328
  >>> client = Client("http://localhost.com", "masterKey")
7838
7329
  >>> index = client.index("movies")
@@ -7848,16 +7339,13 @@ class Index(_BaseIndex):
7848
7339
  """Reset an index's separator tokens settings to the default value.
7849
7340
 
7850
7341
  Returns:
7851
-
7852
7342
  The details of the task status.
7853
7343
 
7854
7344
  Raises:
7855
-
7856
7345
  MeilisearchCommunicationError: If there was an error communicating with the server.
7857
7346
  MeilisearchApiError: If the Meilisearch API returned an error.
7858
7347
 
7859
- Examples:
7860
-
7348
+ Examples
7861
7349
  >>> from meilisearch_async_client import Client
7862
7350
  >>> client = Client("http://localhost.com", "masterKey")
7863
7351
  >>> index = client.index("movies")
@@ -7871,16 +7359,13 @@ class Index(_BaseIndex):
7871
7359
  """Get non-separator token settings for the index.
7872
7360
 
7873
7361
  Returns:
7874
-
7875
7362
  Non-separator tokens for the index.
7876
7363
 
7877
7364
  Raises:
7878
-
7879
7365
  MeilisearchCommunicationError: If there was an error communicating with the server.
7880
7366
  MeilisearchApiError: If the Meilisearch API returned an error.
7881
7367
 
7882
- Examples:
7883
-
7368
+ Examples
7884
7369
  >>> from meilisearch_async_client import Client
7885
7370
  >>> client = Client("http://localhost.com", "masterKey")
7886
7371
  >>> index = client.index("movies")
@@ -7896,21 +7381,17 @@ class Index(_BaseIndex):
7896
7381
  """Update the non-separator tokens settings for an index.
7897
7382
 
7898
7383
  Args:
7899
-
7900
7384
  non_separator_tokens: List of non-separator tokens.
7901
7385
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7902
7386
 
7903
7387
  Returns:
7904
-
7905
7388
  Task to track the action.
7906
7389
 
7907
7390
  Raises:
7908
-
7909
7391
  MeilisearchCommunicationError: If there was an error communicating with the server.
7910
7392
  MeilisearchApiError: If the Meilisearch API returned an error.
7911
7393
 
7912
- Examples:
7913
-
7394
+ Examples
7914
7395
  >>> from meilisearch_python_sdk import Client
7915
7396
  >>> client = Client("http://localhost.com", "masterKey")
7916
7397
  >>> index = client.index("movies")
@@ -7926,16 +7407,13 @@ class Index(_BaseIndex):
7926
7407
  """Reset an index's non-separator tokens settings to the default value.
7927
7408
 
7928
7409
  Returns:
7929
-
7930
7410
  The details of the task status.
7931
7411
 
7932
7412
  Raises:
7933
-
7934
7413
  MeilisearchCommunicationError: If there was an error communicating with the server.
7935
7414
  MeilisearchApiError: If the Meilisearch API returned an error.
7936
7415
 
7937
- Examples:
7938
-
7416
+ Examples
7939
7417
  >>> from meilisearch_async_client import Client
7940
7418
  >>> client = Client("http://localhost.com", "masterKey")
7941
7419
  >>> index = client.index("movies")
@@ -7949,16 +7427,13 @@ class Index(_BaseIndex):
7949
7427
  """Get search cutoff time in ms.
7950
7428
 
7951
7429
  Returns:
7952
-
7953
7430
  Integer representing the search cutoff time in ms, or None.
7954
7431
 
7955
7432
  Raises:
7956
-
7957
7433
  MeilisearchCommunicationError: If there was an error communicating with the server.
7958
7434
  MeilisearchApiError: If the Meilisearch API returned an error.
7959
7435
 
7960
- Examples:
7961
-
7436
+ Examples
7962
7437
  >>> from meilisearch_async_client import Client
7963
7438
  >>> client = Client("http://localhost.com", "masterKey")
7964
7439
  >>> index = client.index("movies")
@@ -7972,21 +7447,17 @@ class Index(_BaseIndex):
7972
7447
  """Update the search cutoff for an index.
7973
7448
 
7974
7449
  Args:
7975
-
7976
7450
  search_cutoff_ms: Integer value of the search cutoff time in ms.
7977
7451
  compress: If set to True the data will be sent in gzip format. Defaults to False.
7978
7452
 
7979
7453
  Returns:
7980
-
7981
7454
  Task to track the action.
7982
7455
 
7983
7456
  Raises:
7984
-
7985
7457
  MeilisearchCommunicationError: If there was an error communicating with the server.
7986
7458
  MeilisearchApiError: If the Meilisearch API returned an error.
7987
7459
 
7988
- Examples:
7989
-
7460
+ Examples
7990
7461
  >>> from meilisearch_python_sdk import Client
7991
7462
  >>> client = Client("http://localhost.com", "masterKey")
7992
7463
  >>> index = client.index("movies")
@@ -8002,16 +7473,13 @@ class Index(_BaseIndex):
8002
7473
  """Reset the search cutoff time to the default value.
8003
7474
 
8004
7475
  Returns:
8005
-
8006
7476
  The details of the task status.
8007
7477
 
8008
7478
  Raises:
8009
-
8010
7479
  MeilisearchCommunicationError: If there was an error communicating with the server.
8011
7480
  MeilisearchApiError: If the Meilisearch API returned an error.
8012
7481
 
8013
- Examples:
8014
-
7482
+ Examples
8015
7483
  >>> from meilisearch_async_client import Client
8016
7484
  >>> client = Client("http://localhost.com", "masterKey")
8017
7485
  >>> index = client.index("movies")
@@ -8025,16 +7493,13 @@ class Index(_BaseIndex):
8025
7493
  """Get word dictionary settings for the index.
8026
7494
 
8027
7495
  Returns:
8028
-
8029
7496
  Word dictionary for the index.
8030
7497
 
8031
7498
  Raises:
8032
-
8033
7499
  MeilisearchCommunicationError: If there was an error communicating with the server.
8034
7500
  MeilisearchApiError: If the Meilisearch API returned an error.
8035
7501
 
8036
- Examples:
8037
-
7502
+ Examples
8038
7503
  >>> from meilisearch_async_client import Client
8039
7504
  >>> client = Client("http://localhost.com", "masterKey")
8040
7505
  >>> index = client.index("movies")
@@ -8048,21 +7513,17 @@ class Index(_BaseIndex):
8048
7513
  """Update the word dictionary settings for an index.
8049
7514
 
8050
7515
  Args:
8051
-
8052
7516
  dictionary: List of dictionary values.
8053
7517
  compress: If set to True the data will be sent in gzip format. Defaults to False.
8054
7518
 
8055
7519
  Returns:
8056
-
8057
7520
  Task to track the action.
8058
7521
 
8059
7522
  Raises:
8060
-
8061
7523
  MeilisearchCommunicationError: If there was an error communicating with the server.
8062
7524
  MeilisearchApiError: If the Meilisearch API returned an error.
8063
7525
 
8064
- Examples:
8065
-
7526
+ Examples
8066
7527
  >>> from meilisearch_python_sdk import Client
8067
7528
  >>> client = Client("http://localhost.com", "masterKey")
8068
7529
  >>> index = client.index("movies")
@@ -8078,16 +7539,13 @@ class Index(_BaseIndex):
8078
7539
  """Reset an index's word dictionary settings to the default value.
8079
7540
 
8080
7541
  Returns:
8081
-
8082
7542
  The details of the task status.
8083
7543
 
8084
7544
  Raises:
8085
-
8086
7545
  MeilisearchCommunicationError: If there was an error communicating with the server.
8087
7546
  MeilisearchApiError: If the Meilisearch API returned an error.
8088
7547
 
8089
- Examples:
8090
-
7548
+ Examples
8091
7549
  >>> from meilisearch_async_client import Client
8092
7550
  >>> client = Client("http://localhost.com", "masterKey")
8093
7551
  >>> index = client.index("movies")
@@ -8101,16 +7559,13 @@ class Index(_BaseIndex):
8101
7559
  """Get proximity precision settings for the index.
8102
7560
 
8103
7561
  Returns:
8104
-
8105
7562
  Proximity precision for the index.
8106
7563
 
8107
7564
  Raises:
8108
-
8109
7565
  MeilisearchCommunicationError: If there was an error communicating with the server.
8110
7566
  MeilisearchApiError: If the Meilisearch API returned an error.
8111
7567
 
8112
- Examples:
8113
-
7568
+ Examples
8114
7569
  >>> from meilisearch_async_client import Client
8115
7570
  >>> client = Client("http://localhost.com", "masterKey")
8116
7571
  >>> index = client.index("movies")
@@ -8126,21 +7581,17 @@ class Index(_BaseIndex):
8126
7581
  """Update the proximity precision settings for an index.
8127
7582
 
8128
7583
  Args:
8129
-
8130
7584
  proximity_precision: The proximity precision value.
8131
7585
  compress: If set to True the data will be sent in gzip format. Defaults to False.
8132
7586
 
8133
7587
  Returns:
8134
-
8135
7588
  Task to track the action.
8136
7589
 
8137
7590
  Raises:
8138
-
8139
7591
  MeilisearchCommunicationError: If there was an error communicating with the server.
8140
7592
  MeilisearchApiError: If the Meilisearch API returned an error.
8141
7593
 
8142
- Examples:
8143
-
7594
+ Examples
8144
7595
  >>> from meilisearch_python_sdk import Client
8145
7596
  >>> from meilisearch_python_sdk.models.settings import ProximityPrecision
8146
7597
  >>> client = Client("http://localhost.com", "masterKey")
@@ -8159,16 +7610,13 @@ class Index(_BaseIndex):
8159
7610
  """Reset an index's proximity precision settings to the default value.
8160
7611
 
8161
7612
  Returns:
8162
-
8163
7613
  The details of the task status.
8164
7614
 
8165
7615
  Raises:
8166
-
8167
7616
  MeilisearchCommunicationError: If there was an error communicating with the server.
8168
7617
  MeilisearchApiError: If the Meilisearch API returned an error.
8169
7618
 
8170
- Examples:
8171
-
7619
+ Examples
8172
7620
  >>> from meilisearch_async_client import Client
8173
7621
  >>> client = Client("http://localhost.com", "masterKey")
8174
7622
  >>> index = client.index("movies")
@@ -8182,16 +7630,13 @@ class Index(_BaseIndex):
8182
7630
  """Get embedder settings for the index.
8183
7631
 
8184
7632
  Returns:
8185
-
8186
7633
  Embedders for the index.
8187
7634
 
8188
7635
  Raises:
8189
-
8190
7636
  MeilisearchCommunicationError: If there was an error communicating with the server.
8191
7637
  MeilisearchApiError: If the Meilisearch API returned an error.
8192
7638
 
8193
- Examples:
8194
-
7639
+ Examples
8195
7640
  >>> from meilisearch_async_client import Client
8196
7641
  >>> client = Client("http://localhost.com", "masterKey")
8197
7642
  >>> index = client.index("movies")
@@ -8205,21 +7650,17 @@ class Index(_BaseIndex):
8205
7650
  """Update the embedders settings for an index.
8206
7651
 
8207
7652
  Args:
8208
-
8209
7653
  embedders: The embedders value.
8210
7654
  compress: If set to True the data will be sent in gzip format. Defaults to False.
8211
7655
 
8212
7656
  Returns:
8213
-
8214
7657
  Task to track the action.
8215
7658
 
8216
7659
  Raises:
8217
-
8218
7660
  MeilisearchCommunicationError: If there was an error communicating with the server.
8219
7661
  MeilisearchApiError: If the Meilisearch API returned an error.
8220
7662
 
8221
- Examples:
8222
-
7663
+ Examples
8223
7664
  >>> from meilisearch_python_sdk import Client
8224
7665
  >>> from meilisearch_python_sdk.models.settings import Embedders, UserProvidedEmbedder
8225
7666
  >>> client = Client("http://localhost.com", "masterKey")
@@ -8245,16 +7686,13 @@ class Index(_BaseIndex):
8245
7686
  """Reset an index's embedders settings to the default value.
8246
7687
 
8247
7688
  Returns:
8248
-
8249
7689
  The details of the task status.
8250
7690
 
8251
7691
  Raises:
8252
-
8253
7692
  MeilisearchCommunicationError: If there was an error communicating with the server.
8254
7693
  MeilisearchApiError: If the Meilisearch API returned an error.
8255
7694
 
8256
- Examples:
8257
-
7695
+ Examples
8258
7696
  >>> from meilisearch_async_client import Client
8259
7697
  >>> client = AsyncClient("http://localhost.com", "masterKey")
8260
7698
  >>> index = client.index("movies")
@@ -8268,16 +7706,13 @@ class Index(_BaseIndex):
8268
7706
  """Get localized attributes settings for the index.
8269
7707
 
8270
7708
  Returns:
8271
-
8272
7709
  Localized attributes for the index.
8273
7710
 
8274
7711
  Raises:
8275
-
8276
7712
  MeilisearchCommunicationError: If there was an error communicating with the server.
8277
7713
  MeilisearchApiError: If the Meilisearch API returned an error.
8278
7714
 
8279
- Examples:
8280
-
7715
+ Examples
8281
7716
  >>> from meilisearch_async_client import AsyncClient
8282
7717
  >>> client = Client("http://localhost.com", "masterKey")
8283
7718
  >>> index = client.index("movies")
@@ -8296,21 +7731,17 @@ class Index(_BaseIndex):
8296
7731
  """Update the localized attributes settings for an index.
8297
7732
 
8298
7733
  Args:
8299
-
8300
7734
  localized_attributes: The localized attributes value.
8301
7735
  compress: If set to True the data will be sent in gzip format. Defaults to False.
8302
7736
 
8303
7737
  Returns:
8304
-
8305
7738
  Task to track the action.
8306
7739
 
8307
7740
  Raises:
8308
-
8309
7741
  MeilisearchCommunicationError: If there was an error communicating with the server.
8310
7742
  MeilisearchApiError: If the Meilisearch API returned an error.
8311
7743
 
8312
- Examples:
8313
-
7744
+ Examples
8314
7745
  >>> from meilisearch_python_sdk import AsyncClient
8315
7746
  >>> from meilisearch_python_sdk.models.settings import LocalizedAttributes
8316
7747
  >>>
@@ -8333,16 +7764,13 @@ class Index(_BaseIndex):
8333
7764
  """Reset an index's localized attributes settings to the default value.
8334
7765
 
8335
7766
  Returns:
8336
-
8337
7767
  The details of the task status.
8338
7768
 
8339
7769
  Raises:
8340
-
8341
7770
  MeilisearchCommunicationError: If there was an error communicating with the server.
8342
7771
  MeilisearchApiError: If the Meilisearch API returned an error.
8343
7772
 
8344
- Examples:
8345
-
7773
+ Examples
8346
7774
  >>> from meilisearch_async_client import AsyncClient
8347
7775
  >>> Client("http://localhost.com", "masterKey") as client:
8348
7776
  >>> index = client.index("movies")
@@ -8426,7 +7854,7 @@ async def _async_load_documents_from_file(
8426
7854
  with open(file_path) as f: # noqa: ASYNC101 ASYNC230
8427
7855
  return [await loop.run_in_executor(None, partial(json_handler.loads, x)) for x in f]
8428
7856
 
8429
- async with aiofiles.open(file_path, mode="r") as f: # type: ignore
7857
+ async with aiofiles.open(file_path) as f: # type: ignore
8430
7858
  data = await f.read() # type: ignore
8431
7859
  documents = await loop.run_in_executor(None, partial(json_handler.loads, data))
8432
7860