meilisearch-python-sdk 5.1.0__py3-none-any.whl → 5.3.0__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.
- meilisearch_python_sdk/_client.py +111 -93
- meilisearch_python_sdk/_task.py +4 -4
- meilisearch_python_sdk/_version.py +1 -1
- meilisearch_python_sdk/decorators.py +6 -6
- meilisearch_python_sdk/index.py +336 -326
- {meilisearch_python_sdk-5.1.0.dist-info → meilisearch_python_sdk-5.3.0.dist-info}/METADATA +9 -9
- {meilisearch_python_sdk-5.1.0.dist-info → meilisearch_python_sdk-5.3.0.dist-info}/RECORD +9 -9
- {meilisearch_python_sdk-5.1.0.dist-info → meilisearch_python_sdk-5.3.0.dist-info}/WHEEL +0 -0
- {meilisearch_python_sdk-5.1.0.dist-info → meilisearch_python_sdk-5.3.0.dist-info}/licenses/LICENSE +0 -0
meilisearch_python_sdk/index.py
CHANGED
|
@@ -562,7 +562,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
562
562
|
return self
|
|
563
563
|
|
|
564
564
|
async def fetch_info(self) -> Self:
|
|
565
|
-
"""Gets the
|
|
565
|
+
"""Gets the information about the index.
|
|
566
566
|
|
|
567
567
|
Returns:
|
|
568
568
|
An instance of the AsyncIndex containing the retrieved information.
|
|
@@ -757,7 +757,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
757
757
|
attributes_to_retrieve: Attributes to display in the returned documents.
|
|
758
758
|
Defaults to ["*"].
|
|
759
759
|
attributes_to_crop: Attributes whose values have to be cropped. Defaults to None.
|
|
760
|
-
crop_length: The
|
|
760
|
+
crop_length: The maximum number of words to display. Defaults to 200.
|
|
761
761
|
attributes_to_highlight: Attributes whose values will contain highlighted matching terms.
|
|
762
762
|
Defaults to None.
|
|
763
763
|
sort: Attributes by which to sort the results. Defaults to None.
|
|
@@ -765,7 +765,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
765
765
|
matches should be returned or not. Defaults to False.
|
|
766
766
|
highlight_pre_tag: The opening tag for highlighting text. Defaults to <em>.
|
|
767
767
|
highlight_post_tag: The closing tag for highlighting text. Defaults to </em>
|
|
768
|
-
crop_marker: Marker to display when the number of words
|
|
768
|
+
crop_marker: Marker to display when the number of words exceeds the `crop_length`.
|
|
769
769
|
Defaults to ...
|
|
770
770
|
matching_strategy: Specifies the matching strategy Meilisearch should use. Defaults to
|
|
771
771
|
`last`.
|
|
@@ -1036,7 +1036,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1036
1036
|
attributes_to_retrieve: Attributes to display in the returned documents.
|
|
1037
1037
|
Defaults to ["*"].
|
|
1038
1038
|
attributes_to_crop: Attributes whose values have to be cropped. Defaults to None.
|
|
1039
|
-
crop_length: The
|
|
1039
|
+
crop_length: The maximum number of words to display. Defaults to 200.
|
|
1040
1040
|
attributes_to_highlight: Attributes whose values will contain highlighted matching terms.
|
|
1041
1041
|
Defaults to None.
|
|
1042
1042
|
sort: Attributes by which to sort the results. Defaults to None.
|
|
@@ -1044,7 +1044,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1044
1044
|
matches should be returned or not. Defaults to False.
|
|
1045
1045
|
highlight_pre_tag: The opening tag for highlighting text. Defaults to <em>.
|
|
1046
1046
|
highlight_post_tag: The closing tag for highlighting text. Defaults to </em>
|
|
1047
|
-
crop_marker: Marker to display when the number of words
|
|
1047
|
+
crop_marker: Marker to display when the number of words exceeds the `crop_length`.
|
|
1048
1048
|
Defaults to ...
|
|
1049
1049
|
matching_strategy: Specifies the matching strategy Meilisearch should use. Defaults to
|
|
1050
1050
|
`last`.
|
|
@@ -1372,6 +1372,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1372
1372
|
async def get_documents(
|
|
1373
1373
|
self,
|
|
1374
1374
|
*,
|
|
1375
|
+
ids: list[str] | None = None,
|
|
1375
1376
|
offset: int = 0,
|
|
1376
1377
|
limit: int = 20,
|
|
1377
1378
|
fields: list[str] | None = None,
|
|
@@ -1382,6 +1383,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1382
1383
|
"""Get a batch documents from the index.
|
|
1383
1384
|
|
|
1384
1385
|
Args:
|
|
1386
|
+
ids: Array of document primary keys to retrieve. Defaults to None (Gets all documents).
|
|
1385
1387
|
offset: Number of documents to skip. Defaults to 0.
|
|
1386
1388
|
limit: Maximum number of documents returnedd. Defaults to 20.
|
|
1387
1389
|
fields: Document attributes to show. If this value is None then all
|
|
@@ -1418,7 +1420,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1418
1420
|
if retrieve_vectors:
|
|
1419
1421
|
parameters["retrieveVectors"] = "true"
|
|
1420
1422
|
|
|
1421
|
-
if not filter:
|
|
1423
|
+
if not filter and not ids:
|
|
1422
1424
|
if fields:
|
|
1423
1425
|
parameters["fields"] = ",".join(fields)
|
|
1424
1426
|
|
|
@@ -1432,6 +1434,9 @@ class AsyncIndex(_BaseIndex):
|
|
|
1432
1434
|
|
|
1433
1435
|
parameters["filter"] = filter
|
|
1434
1436
|
|
|
1437
|
+
if ids:
|
|
1438
|
+
parameters["ids"] = ids
|
|
1439
|
+
|
|
1435
1440
|
response = await self._http_requests.post(f"{self._documents_url}/fetch", body=parameters)
|
|
1436
1441
|
|
|
1437
1442
|
return DocumentsInfo(**response.json())
|
|
@@ -1663,8 +1668,8 @@ class AsyncIndex(_BaseIndex):
|
|
|
1663
1668
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
1664
1669
|
Defaults to None.
|
|
1665
1670
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
1666
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
1667
|
-
the field names, and ever for should have a title.
|
|
1671
|
+
ndjson. For csv files the first row of the document should be a header row
|
|
1672
|
+
containing the field names, and ever for should have a title.
|
|
1668
1673
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
1669
1674
|
can only be used if the file is a csv file. Defaults to comma.
|
|
1670
1675
|
combine_documents: If set to True this will combine the documents from all the files
|
|
@@ -1827,7 +1832,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
1827
1832
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
1828
1833
|
Defaults to None.
|
|
1829
1834
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
1830
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
1835
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
1831
1836
|
the field names, and ever for should have a title.
|
|
1832
1837
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
1833
1838
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -2350,7 +2355,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
2350
2355
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
2351
2356
|
Defaults to None.
|
|
2352
2357
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
2353
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
2358
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
2354
2359
|
the field names, and ever for should have a title.
|
|
2355
2360
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
2356
2361
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -2462,7 +2467,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
2462
2467
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
2463
2468
|
Defaults to None.
|
|
2464
2469
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
2465
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
2470
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
2466
2471
|
the field names, and ever for should have a title.
|
|
2467
2472
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
2468
2473
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -2907,7 +2912,7 @@ class AsyncIndex(_BaseIndex):
|
|
|
2907
2912
|
MeilisearchApiError: If the Meilisearch API returned an error.
|
|
2908
2913
|
|
|
2909
2914
|
Examples
|
|
2910
|
-
>>> from
|
|
2915
|
+
>>> from meilisearch_python_sdk import AsyncClient
|
|
2911
2916
|
>>> async with AsyncClient("http://localhost.com", "masterKey") as client:
|
|
2912
2917
|
>>> index = client.index("movies")
|
|
2913
2918
|
>>> await index.delete_documents_by_filter("genre=horor"))
|
|
@@ -4952,9 +4957,9 @@ class Index(_BaseIndex):
|
|
|
4952
4957
|
|
|
4953
4958
|
Examples
|
|
4954
4959
|
>>> from meilisearch_python_sdk import Client
|
|
4955
|
-
>>>
|
|
4956
|
-
>>>
|
|
4957
|
-
>>>
|
|
4960
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
4961
|
+
>>> index = client.index("movies")
|
|
4962
|
+
>>> index.compact()
|
|
4958
4963
|
"""
|
|
4959
4964
|
response = self._http_requests.post(f"{self._base_url_with_uid}/compact")
|
|
4960
4965
|
return TaskInfo(**response.json())
|
|
@@ -4971,9 +4976,9 @@ class Index(_BaseIndex):
|
|
|
4971
4976
|
|
|
4972
4977
|
Examples
|
|
4973
4978
|
>>> from meilisearch_python_sdk import Client
|
|
4974
|
-
>>>
|
|
4975
|
-
>>>
|
|
4976
|
-
>>>
|
|
4979
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
4980
|
+
>>> index = client.index("movies")
|
|
4981
|
+
>>> index.delete()
|
|
4977
4982
|
"""
|
|
4978
4983
|
response = self._http_requests.delete(self._base_url_with_uid)
|
|
4979
4984
|
return TaskInfo(**response.json())
|
|
@@ -4990,9 +4995,9 @@ class Index(_BaseIndex):
|
|
|
4990
4995
|
|
|
4991
4996
|
Examples
|
|
4992
4997
|
>>> from meilisearch_python_sdk import Client
|
|
4993
|
-
>>>
|
|
4994
|
-
>>>
|
|
4995
|
-
>>>
|
|
4998
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
4999
|
+
>>> index = client.index("movies")
|
|
5000
|
+
>>> index.delete_if_exists()
|
|
4996
5001
|
"""
|
|
4997
5002
|
response = self.delete()
|
|
4998
5003
|
status = wait_for_task(self.http_client, response.task_uid, timeout_in_ms=100000)
|
|
@@ -5016,9 +5021,9 @@ class Index(_BaseIndex):
|
|
|
5016
5021
|
|
|
5017
5022
|
Examples
|
|
5018
5023
|
>>> from meilisearch_python_sdk import Client
|
|
5019
|
-
>>>
|
|
5020
|
-
>>>
|
|
5021
|
-
>>>
|
|
5024
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5025
|
+
>>> index = client.index("movies")
|
|
5026
|
+
>>> updated_index = index.update()
|
|
5022
5027
|
"""
|
|
5023
5028
|
payload = {"primaryKey": primary_key}
|
|
5024
5029
|
response = self._http_requests.patch(self._base_url_with_uid, payload)
|
|
@@ -5028,7 +5033,7 @@ class Index(_BaseIndex):
|
|
|
5028
5033
|
return self
|
|
5029
5034
|
|
|
5030
5035
|
def fetch_info(self) -> Self:
|
|
5031
|
-
"""Gets the
|
|
5036
|
+
"""Gets the information about the index.
|
|
5032
5037
|
|
|
5033
5038
|
Returns:
|
|
5034
5039
|
An instance of the AsyncIndex containing the retrieved information.
|
|
@@ -5039,9 +5044,9 @@ class Index(_BaseIndex):
|
|
|
5039
5044
|
|
|
5040
5045
|
Examples
|
|
5041
5046
|
>>> from meilisearch_python_sdk import Client
|
|
5042
|
-
>>>
|
|
5043
|
-
>>>
|
|
5044
|
-
>>>
|
|
5047
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5048
|
+
>>> index = client.index("movies")
|
|
5049
|
+
>>> index_info = index.fetch_info()
|
|
5045
5050
|
"""
|
|
5046
5051
|
response = self._http_requests.get(self._base_url_with_uid)
|
|
5047
5052
|
index_dict = response.json()
|
|
@@ -5062,9 +5067,9 @@ class Index(_BaseIndex):
|
|
|
5062
5067
|
|
|
5063
5068
|
Examples
|
|
5064
5069
|
>>> from meilisearch_python_sdk import Client
|
|
5065
|
-
>>>
|
|
5066
|
-
>>>
|
|
5067
|
-
>>>
|
|
5070
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5071
|
+
>>> index = client.index("movies")
|
|
5072
|
+
>>> primary_key = index.get_primary_key()
|
|
5068
5073
|
"""
|
|
5069
5074
|
info = self.fetch_info()
|
|
5070
5075
|
return info.primary_key
|
|
@@ -5121,8 +5126,8 @@ class Index(_BaseIndex):
|
|
|
5121
5126
|
|
|
5122
5127
|
Examples
|
|
5123
5128
|
>>> from meilisearch_python_sdk import Client
|
|
5124
|
-
>>>
|
|
5125
|
-
>>>
|
|
5129
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5130
|
+
>>> index = index.create(client, "movies")
|
|
5126
5131
|
"""
|
|
5127
5132
|
if not primary_key:
|
|
5128
5133
|
payload = {"uid": uid}
|
|
@@ -5166,9 +5171,9 @@ class Index(_BaseIndex):
|
|
|
5166
5171
|
|
|
5167
5172
|
Examples
|
|
5168
5173
|
>>> from meilisearch_python_sdk import Client
|
|
5169
|
-
>>>
|
|
5170
|
-
>>>
|
|
5171
|
-
>>>
|
|
5174
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5175
|
+
>>> index = client.index("movies")
|
|
5176
|
+
>>> stats = index.get_stats()
|
|
5172
5177
|
"""
|
|
5173
5178
|
response = self._http_requests.get(self._stats_url)
|
|
5174
5179
|
|
|
@@ -5216,7 +5221,7 @@ class Index(_BaseIndex):
|
|
|
5216
5221
|
attributes_to_retrieve: Attributes to display in the returned documents.
|
|
5217
5222
|
Defaults to ["*"].
|
|
5218
5223
|
attributes_to_crop: Attributes whose values have to be cropped. Defaults to None.
|
|
5219
|
-
crop_length: The
|
|
5224
|
+
crop_length: The maximum number of words to display. Defaults to 200.
|
|
5220
5225
|
attributes_to_highlight: Attributes whose values will contain highlighted matching terms.
|
|
5221
5226
|
Defaults to None.
|
|
5222
5227
|
sort: Attributes by which to sort the results. Defaults to None.
|
|
@@ -5224,7 +5229,7 @@ class Index(_BaseIndex):
|
|
|
5224
5229
|
matches should be returned or not. Defaults to False.
|
|
5225
5230
|
highlight_pre_tag: The opening tag for highlighting text. Defaults to <em>.
|
|
5226
5231
|
highlight_post_tag: The closing tag for highlighting text. Defaults to </em>
|
|
5227
|
-
crop_marker: Marker to display when the number of words
|
|
5232
|
+
crop_marker: Marker to display when the number of words exceeds the `crop_length`.
|
|
5228
5233
|
Defaults to ...
|
|
5229
5234
|
matching_strategy: Specifies the matching strategy Meilisearch should use. Defaults to
|
|
5230
5235
|
`last`.
|
|
@@ -5282,9 +5287,9 @@ class Index(_BaseIndex):
|
|
|
5282
5287
|
|
|
5283
5288
|
Examples
|
|
5284
5289
|
>>> from meilisearch_python_sdk import Client
|
|
5285
|
-
>>>
|
|
5286
|
-
>>>
|
|
5287
|
-
>>>
|
|
5290
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5291
|
+
>>> index = client.index("movies")
|
|
5292
|
+
>>> search_results = index.search("Tron")
|
|
5288
5293
|
"""
|
|
5289
5294
|
if ranking_score_threshold:
|
|
5290
5295
|
_validate_ranking_score_threshold(ranking_score_threshold)
|
|
@@ -5401,7 +5406,7 @@ class Index(_BaseIndex):
|
|
|
5401
5406
|
attributes_to_retrieve: Attributes to display in the returned documents.
|
|
5402
5407
|
Defaults to ["*"].
|
|
5403
5408
|
attributes_to_crop: Attributes whose values have to be cropped. Defaults to None.
|
|
5404
|
-
crop_length: The
|
|
5409
|
+
crop_length: The maximum number of words to display. Defaults to 200.
|
|
5405
5410
|
attributes_to_highlight: Attributes whose values will contain highlighted matching terms.
|
|
5406
5411
|
Defaults to None.
|
|
5407
5412
|
sort: Attributes by which to sort the results. Defaults to None.
|
|
@@ -5409,7 +5414,7 @@ class Index(_BaseIndex):
|
|
|
5409
5414
|
matches should be returned or not. Defaults to False.
|
|
5410
5415
|
highlight_pre_tag: The opening tag for highlighting text. Defaults to <em>.
|
|
5411
5416
|
highlight_post_tag: The closing tag for highlighting text. Defaults to </em>
|
|
5412
|
-
crop_marker: Marker to display when the number of words
|
|
5417
|
+
crop_marker: Marker to display when the number of words exceeds the `crop_length`.
|
|
5413
5418
|
Defaults to ...
|
|
5414
5419
|
matching_strategy: Specifies the matching strategy Meilisearch should use. Defaults to
|
|
5415
5420
|
`last`.
|
|
@@ -5453,13 +5458,13 @@ class Index(_BaseIndex):
|
|
|
5453
5458
|
|
|
5454
5459
|
Examples
|
|
5455
5460
|
>>> from meilisearch_python_sdk import Client
|
|
5456
|
-
>>>
|
|
5457
|
-
>>>
|
|
5458
|
-
>>>
|
|
5459
|
-
>>>
|
|
5460
|
-
>>>
|
|
5461
|
-
>>>
|
|
5462
|
-
>>>
|
|
5461
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5462
|
+
>>> index = client.index("movies")
|
|
5463
|
+
>>> search_results = index.search(
|
|
5464
|
+
>>> "Tron",
|
|
5465
|
+
>>> facet_name="genre",
|
|
5466
|
+
>>> facet_query="Sci-fi"
|
|
5467
|
+
>>> )
|
|
5463
5468
|
"""
|
|
5464
5469
|
if ranking_score_threshold:
|
|
5465
5470
|
_validate_ranking_score_threshold(ranking_score_threshold)
|
|
@@ -5572,9 +5577,9 @@ class Index(_BaseIndex):
|
|
|
5572
5577
|
|
|
5573
5578
|
Examples
|
|
5574
5579
|
>>> from meilisearch_python_sdk import Client
|
|
5575
|
-
>>>
|
|
5576
|
-
>>>
|
|
5577
|
-
>>>
|
|
5580
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5581
|
+
>>> index = client.index("movies")
|
|
5582
|
+
>>> search_results = index.search_similar_documents("123")
|
|
5578
5583
|
"""
|
|
5579
5584
|
payload = {
|
|
5580
5585
|
"id": id,
|
|
@@ -5621,9 +5626,9 @@ class Index(_BaseIndex):
|
|
|
5621
5626
|
|
|
5622
5627
|
Examples
|
|
5623
5628
|
>>> from meilisearch_python_sdk import Client
|
|
5624
|
-
>>>
|
|
5625
|
-
>>>
|
|
5626
|
-
>>>
|
|
5629
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5630
|
+
>>> index = client.index("movies")
|
|
5631
|
+
>>> document = index.get_document("1234")
|
|
5627
5632
|
"""
|
|
5628
5633
|
parameters: JsonDict = {}
|
|
5629
5634
|
|
|
@@ -5640,6 +5645,7 @@ class Index(_BaseIndex):
|
|
|
5640
5645
|
def get_documents(
|
|
5641
5646
|
self,
|
|
5642
5647
|
*,
|
|
5648
|
+
ids: list[str] | None = None,
|
|
5643
5649
|
offset: int = 0,
|
|
5644
5650
|
limit: int = 20,
|
|
5645
5651
|
fields: list[str] | None = None,
|
|
@@ -5650,6 +5656,7 @@ class Index(_BaseIndex):
|
|
|
5650
5656
|
"""Get a batch documents from the index.
|
|
5651
5657
|
|
|
5652
5658
|
Args:
|
|
5659
|
+
ids: Array of document primary keys to retrieve. Defaults to None (Gets all documents).
|
|
5653
5660
|
offset: Number of documents to skip. Defaults to 0.
|
|
5654
5661
|
limit: Maximum number of documents returnedd. Defaults to 20.
|
|
5655
5662
|
fields: Document attributes to show. If this value is None then all
|
|
@@ -5671,9 +5678,9 @@ class Index(_BaseIndex):
|
|
|
5671
5678
|
|
|
5672
5679
|
Examples
|
|
5673
5680
|
>>> from meilisearch_python_sdk import Client
|
|
5674
|
-
>>>
|
|
5675
|
-
>>>
|
|
5676
|
-
>>>
|
|
5681
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5682
|
+
>>> index = client.index("movies")
|
|
5683
|
+
>>> documents = index.get_documents()
|
|
5677
5684
|
"""
|
|
5678
5685
|
parameters: JsonDict = {
|
|
5679
5686
|
"offset": offset,
|
|
@@ -5686,7 +5693,7 @@ class Index(_BaseIndex):
|
|
|
5686
5693
|
if retrieve_vectors:
|
|
5687
5694
|
parameters["retrieveVectors"] = "true"
|
|
5688
5695
|
|
|
5689
|
-
if not filter:
|
|
5696
|
+
if not filter and not ids:
|
|
5690
5697
|
if fields:
|
|
5691
5698
|
parameters["fields"] = ",".join(fields)
|
|
5692
5699
|
|
|
@@ -5700,6 +5707,9 @@ class Index(_BaseIndex):
|
|
|
5700
5707
|
|
|
5701
5708
|
parameters["filter"] = filter
|
|
5702
5709
|
|
|
5710
|
+
if ids:
|
|
5711
|
+
parameters["ids"] = ids
|
|
5712
|
+
|
|
5703
5713
|
response = self._http_requests.post(f"{self._documents_url}/fetch", body=parameters)
|
|
5704
5714
|
|
|
5705
5715
|
return DocumentsInfo(**response.json())
|
|
@@ -5732,9 +5742,9 @@ class Index(_BaseIndex):
|
|
|
5732
5742
|
>>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
|
|
5733
5743
|
>>> {"id": 2, "title": "Movie 2", "genre": "drama"},
|
|
5734
5744
|
>>> ]
|
|
5735
|
-
>>>
|
|
5736
|
-
>>>
|
|
5737
|
-
>>>
|
|
5745
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5746
|
+
>>> index = client.index("movies")
|
|
5747
|
+
>>> index.add_documents(documents)
|
|
5738
5748
|
"""
|
|
5739
5749
|
if primary_key:
|
|
5740
5750
|
url = _build_encoded_url(self._documents_url, {"primaryKey": primary_key})
|
|
@@ -5791,9 +5801,9 @@ class Index(_BaseIndex):
|
|
|
5791
5801
|
>>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
|
|
5792
5802
|
>>> {"id": 2, "title": "Movie 2", "genre": "drama"},
|
|
5793
5803
|
>>> ]
|
|
5794
|
-
>>>
|
|
5795
|
-
>>>
|
|
5796
|
-
>>>
|
|
5804
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5805
|
+
>>> index = client.index("movies")
|
|
5806
|
+
>>> index.add_documents_in_batches(documents)
|
|
5797
5807
|
"""
|
|
5798
5808
|
return [
|
|
5799
5809
|
self.add_documents(x, primary_key, compress=compress)
|
|
@@ -5817,7 +5827,7 @@ class Index(_BaseIndex):
|
|
|
5817
5827
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
5818
5828
|
Defaults to None.
|
|
5819
5829
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
5820
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
5830
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
5821
5831
|
the field names, and ever for should have a title.
|
|
5822
5832
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
5823
5833
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -5838,9 +5848,9 @@ class Index(_BaseIndex):
|
|
|
5838
5848
|
>>> from pathlib import Path
|
|
5839
5849
|
>>> from meilisearch_python_sdk import Client
|
|
5840
5850
|
>>> directory_path = Path("/path/to/directory/containing/files")
|
|
5841
|
-
>>>
|
|
5842
|
-
>>>
|
|
5843
|
-
>>>
|
|
5851
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5852
|
+
>>> index = client.index("movies")
|
|
5853
|
+
>>> index.add_documents_from_directory(directory_path)
|
|
5844
5854
|
"""
|
|
5845
5855
|
directory = Path(directory_path) if isinstance(directory_path, str) else directory_path
|
|
5846
5856
|
|
|
@@ -5893,7 +5903,7 @@ class Index(_BaseIndex):
|
|
|
5893
5903
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
5894
5904
|
Defaults to None.
|
|
5895
5905
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
5896
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
5906
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
5897
5907
|
the field names, and ever for should have a title.
|
|
5898
5908
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
5899
5909
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -5914,9 +5924,9 @@ class Index(_BaseIndex):
|
|
|
5914
5924
|
>>> from pathlib import Path
|
|
5915
5925
|
>>> from meilisearch_python_sdk import Client
|
|
5916
5926
|
>>> directory_path = Path("/path/to/directory/containing/files")
|
|
5917
|
-
>>>
|
|
5918
|
-
>>>
|
|
5919
|
-
>>>
|
|
5927
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
5928
|
+
>>> index = client.index("movies")
|
|
5929
|
+
>>> index.add_documents_from_directory_in_batches(directory_path)
|
|
5920
5930
|
"""
|
|
5921
5931
|
directory = Path(directory_path) if isinstance(directory_path, str) else directory_path
|
|
5922
5932
|
|
|
@@ -5987,9 +5997,9 @@ class Index(_BaseIndex):
|
|
|
5987
5997
|
>>> from pathlib import Path
|
|
5988
5998
|
>>> from meilisearch_python_sdk import Client
|
|
5989
5999
|
>>> file_path = Path("/path/to/file.json")
|
|
5990
|
-
>>>
|
|
5991
|
-
>>>
|
|
5992
|
-
>>>
|
|
6000
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6001
|
+
>>> index = client.index("movies")
|
|
6002
|
+
>>> index.add_documents_from_file(file_path)
|
|
5993
6003
|
"""
|
|
5994
6004
|
documents = _load_documents_from_file(file_path, json_handler=self._json_handler)
|
|
5995
6005
|
|
|
@@ -6029,9 +6039,9 @@ class Index(_BaseIndex):
|
|
|
6029
6039
|
>>> from pathlib import Path
|
|
6030
6040
|
>>> from meilisearch_python_sdk import Client
|
|
6031
6041
|
>>> file_path = Path("/path/to/file.json")
|
|
6032
|
-
>>>
|
|
6033
|
-
>>>
|
|
6034
|
-
>>>
|
|
6042
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6043
|
+
>>> index = client.index("movies")
|
|
6044
|
+
>>> index.add_documents_from_file_in_batches(file_path)
|
|
6035
6045
|
"""
|
|
6036
6046
|
documents = _load_documents_from_file(
|
|
6037
6047
|
file_path, csv_delimiter, json_handler=self._json_handler
|
|
@@ -6080,9 +6090,9 @@ class Index(_BaseIndex):
|
|
|
6080
6090
|
>>> from pathlib import Path
|
|
6081
6091
|
>>> from meilisearch_python_sdk import Client
|
|
6082
6092
|
>>> file_path = Path("/path/to/file.csv")
|
|
6083
|
-
>>>
|
|
6084
|
-
>>>
|
|
6085
|
-
>>>
|
|
6093
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6094
|
+
>>> index = client.index("movies")
|
|
6095
|
+
>>> index.add_documents_from_raw_file(file_path)
|
|
6086
6096
|
"""
|
|
6087
6097
|
upload_path = Path(file_path) if isinstance(file_path, str) else file_path
|
|
6088
6098
|
if not upload_path.exists():
|
|
@@ -6148,9 +6158,9 @@ class Index(_BaseIndex):
|
|
|
6148
6158
|
|
|
6149
6159
|
Examples
|
|
6150
6160
|
>>> from meilisearch_python_sdk import Client
|
|
6151
|
-
>>>
|
|
6152
|
-
>>>
|
|
6153
|
-
>>>
|
|
6161
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6162
|
+
>>> index = client.index("movies")
|
|
6163
|
+
>>> index.edit_documents("doc.title = `${doc.title.to_upper()}`")
|
|
6154
6164
|
"""
|
|
6155
6165
|
url = f"{self._documents_url}/edit"
|
|
6156
6166
|
payload: JsonDict = {"function": function}
|
|
@@ -6193,9 +6203,9 @@ class Index(_BaseIndex):
|
|
|
6193
6203
|
>>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
|
|
6194
6204
|
>>> {"id": 2, "title": "Movie 2", "genre": "drama"},
|
|
6195
6205
|
>>> ]
|
|
6196
|
-
>>>
|
|
6197
|
-
>>>
|
|
6198
|
-
>>>
|
|
6206
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6207
|
+
>>> index = client.index("movies")
|
|
6208
|
+
>>> index.update_documents(documents)
|
|
6199
6209
|
"""
|
|
6200
6210
|
if primary_key:
|
|
6201
6211
|
url = _build_encoded_url(self._documents_url, {"primaryKey": primary_key})
|
|
@@ -6256,9 +6266,9 @@ class Index(_BaseIndex):
|
|
|
6256
6266
|
>>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
|
|
6257
6267
|
>>> {"id": 2, "title": "Movie 2", "genre": "drama"},
|
|
6258
6268
|
>>> ]
|
|
6259
|
-
>>>
|
|
6260
|
-
>>>
|
|
6261
|
-
>>>
|
|
6269
|
+
>>> with Client("http://localhost.com", "masterKey") client:
|
|
6270
|
+
>>> index = client.index("movies")
|
|
6271
|
+
>>> index.update_documents_in_batches(documents)
|
|
6262
6272
|
"""
|
|
6263
6273
|
return [
|
|
6264
6274
|
self.update_documents(x, primary_key, compress=compress)
|
|
@@ -6282,7 +6292,7 @@ class Index(_BaseIndex):
|
|
|
6282
6292
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
6283
6293
|
Defaults to None.
|
|
6284
6294
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
6285
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
6295
|
+
ndjson. For csv files the first row of the document should be a header row containing
|
|
6286
6296
|
the field names, and ever for should have a title.
|
|
6287
6297
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
6288
6298
|
can only be used if the file is a csv file. Defaults to comma.
|
|
@@ -6303,9 +6313,9 @@ class Index(_BaseIndex):
|
|
|
6303
6313
|
>>> from pathlib import Path
|
|
6304
6314
|
>>> from meilisearch_python_sdk import Client
|
|
6305
6315
|
>>> directory_path = Path("/path/to/directory/containing/files")
|
|
6306
|
-
>>>
|
|
6307
|
-
>>>
|
|
6308
|
-
>>>
|
|
6316
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6317
|
+
>>> index = client.index("movies")
|
|
6318
|
+
>>> index.update_documents_from_directory(directory_path)
|
|
6309
6319
|
"""
|
|
6310
6320
|
directory = Path(directory_path) if isinstance(directory_path, str) else directory_path
|
|
6311
6321
|
|
|
@@ -6357,8 +6367,8 @@ class Index(_BaseIndex):
|
|
|
6357
6367
|
primary_key: The primary key of the documents. This will be ignored if already set.
|
|
6358
6368
|
Defaults to None.
|
|
6359
6369
|
document_type: The type of document being added. Accepted types are json, csv, and
|
|
6360
|
-
ndjson. For csv files the first row of the document should be a header row
|
|
6361
|
-
the field names, and ever for should have a title.
|
|
6370
|
+
ndjson. For csv files the first row of the document should be a header row
|
|
6371
|
+
containing the field names, and ever for should have a title.
|
|
6362
6372
|
csv_delimiter: A single ASCII character to specify the delimiter for csv files. This
|
|
6363
6373
|
can only be used if the file is a csv file. Defaults to comma.
|
|
6364
6374
|
combine_documents: If set to True this will combine the documents from all the files
|
|
@@ -6378,9 +6388,9 @@ class Index(_BaseIndex):
|
|
|
6378
6388
|
>>> from pathlib import Path
|
|
6379
6389
|
>>> from meilisearch_python_sdk import Client
|
|
6380
6390
|
>>> directory_path = Path("/path/to/directory/containing/files")
|
|
6381
|
-
>>>
|
|
6382
|
-
>>>
|
|
6383
|
-
>>>
|
|
6391
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6392
|
+
>>> index = client.index("movies")
|
|
6393
|
+
>>> index.update_documents_from_directory_in_batches(directory_path)
|
|
6384
6394
|
"""
|
|
6385
6395
|
directory = Path(directory_path) if isinstance(directory_path, str) else directory_path
|
|
6386
6396
|
|
|
@@ -6453,9 +6463,9 @@ class Index(_BaseIndex):
|
|
|
6453
6463
|
>>> from pathlib import Path
|
|
6454
6464
|
>>> from meilisearch_python_sdk import Client
|
|
6455
6465
|
>>> file_path = Path("/path/to/file.json")
|
|
6456
|
-
>>>
|
|
6457
|
-
>>>
|
|
6458
|
-
>>>
|
|
6466
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6467
|
+
>>> index = client.index("movies")
|
|
6468
|
+
>>> index.update_documents_from_file(file_path)
|
|
6459
6469
|
"""
|
|
6460
6470
|
documents = _load_documents_from_file(
|
|
6461
6471
|
file_path, csv_delimiter, json_handler=self._json_handler
|
|
@@ -6492,9 +6502,9 @@ class Index(_BaseIndex):
|
|
|
6492
6502
|
>>> from pathlib import Path
|
|
6493
6503
|
>>> from meilisearch_python_sdk import Client
|
|
6494
6504
|
>>> file_path = Path("/path/to/file.json")
|
|
6495
|
-
>>>
|
|
6496
|
-
>>>
|
|
6497
|
-
>>>
|
|
6505
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6506
|
+
>>> index = client.index("movies")
|
|
6507
|
+
>>> index.update_documents_from_file_in_batches(file_path)
|
|
6498
6508
|
"""
|
|
6499
6509
|
documents = _load_documents_from_file(file_path, json_handler=self._json_handler)
|
|
6500
6510
|
|
|
@@ -6541,9 +6551,9 @@ class Index(_BaseIndex):
|
|
|
6541
6551
|
>>> from pathlib import Path
|
|
6542
6552
|
>>> from meilisearch_python_sdk import Client
|
|
6543
6553
|
>>> file_path = Path("/path/to/file.csv")
|
|
6544
|
-
>>>
|
|
6545
|
-
>>>
|
|
6546
|
-
>>>
|
|
6554
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6555
|
+
>>> index = client.index("movies")
|
|
6556
|
+
>>> index.update_documents_from_raw_file(file_path)
|
|
6547
6557
|
"""
|
|
6548
6558
|
upload_path = Path(file_path) if isinstance(file_path, str) else file_path
|
|
6549
6559
|
if not upload_path.exists():
|
|
@@ -6600,9 +6610,9 @@ class Index(_BaseIndex):
|
|
|
6600
6610
|
|
|
6601
6611
|
Examples
|
|
6602
6612
|
>>> from meilisearch_python_sdk import Client
|
|
6603
|
-
>>>
|
|
6604
|
-
>>>
|
|
6605
|
-
>>>
|
|
6613
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6614
|
+
>>> index = client.index("movies")
|
|
6615
|
+
>>> index.delete_document("1234")
|
|
6606
6616
|
"""
|
|
6607
6617
|
if self._pre_delete_document_plugins:
|
|
6608
6618
|
Index._run_plugins(
|
|
@@ -6633,9 +6643,9 @@ class Index(_BaseIndex):
|
|
|
6633
6643
|
|
|
6634
6644
|
Examples
|
|
6635
6645
|
>>> from meilisearch_python_sdk import Client
|
|
6636
|
-
>>>
|
|
6637
|
-
>>>
|
|
6638
|
-
>>>
|
|
6646
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6647
|
+
>>> index = client.index("movies")
|
|
6648
|
+
>>> index.delete_documents(["1234", "5678"])
|
|
6639
6649
|
"""
|
|
6640
6650
|
if self._pre_delete_documents_plugins:
|
|
6641
6651
|
Index._run_plugins(self._pre_delete_documents_plugins, Event.PRE, ids=ids)
|
|
@@ -6666,9 +6676,9 @@ class Index(_BaseIndex):
|
|
|
6666
6676
|
|
|
6667
6677
|
Examples
|
|
6668
6678
|
>>> from meilisearch_python_sdk import Client
|
|
6669
|
-
>>>
|
|
6670
|
-
>>>
|
|
6671
|
-
>>>
|
|
6679
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6680
|
+
>>> index = client.index("movies")
|
|
6681
|
+
>>> index.delete_documents_by_filter("genre=horor"))
|
|
6672
6682
|
"""
|
|
6673
6683
|
if self._pre_delete_documents_by_filter_plugins:
|
|
6674
6684
|
Index._run_plugins(
|
|
@@ -6705,14 +6715,14 @@ class Index(_BaseIndex):
|
|
|
6705
6715
|
|
|
6706
6716
|
Examples
|
|
6707
6717
|
>>> from meilisearch_python_sdk import Client
|
|
6708
|
-
>>>
|
|
6709
|
-
>>>
|
|
6710
|
-
>>>
|
|
6711
|
-
>>>
|
|
6712
|
-
>>>
|
|
6713
|
-
>>>
|
|
6714
|
-
>>>
|
|
6715
|
-
>>>
|
|
6718
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6719
|
+
>>> index = client.index("movies")
|
|
6720
|
+
>>> index.delete_documents_in_batches_by_filter(
|
|
6721
|
+
>>> [
|
|
6722
|
+
>>> "genre=horor"),
|
|
6723
|
+
>>> "release_date=1520035200"),
|
|
6724
|
+
>>> ]
|
|
6725
|
+
>>> )
|
|
6716
6726
|
"""
|
|
6717
6727
|
return [self.delete_documents_by_filter(filter) for filter in filters]
|
|
6718
6728
|
|
|
@@ -6728,9 +6738,9 @@ class Index(_BaseIndex):
|
|
|
6728
6738
|
|
|
6729
6739
|
Examples
|
|
6730
6740
|
>>> from meilisearch_python_sdk import Client
|
|
6731
|
-
>>>
|
|
6732
|
-
>>>
|
|
6733
|
-
>>>
|
|
6741
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6742
|
+
>>> index = client.index("movies")
|
|
6743
|
+
>>> index.delete_all_document()
|
|
6734
6744
|
"""
|
|
6735
6745
|
if self._pre_delete_all_documents_plugins:
|
|
6736
6746
|
Index._run_plugins(self._pre_delete_all_documents_plugins, Event.PRE)
|
|
@@ -6758,9 +6768,9 @@ class Index(_BaseIndex):
|
|
|
6758
6768
|
|
|
6759
6769
|
Examples
|
|
6760
6770
|
>>> from meilisearch_python_sdk import Client
|
|
6761
|
-
>>>
|
|
6762
|
-
>>>
|
|
6763
|
-
>>>
|
|
6771
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6772
|
+
>>> index = client.index("movies")
|
|
6773
|
+
>>> settings = index.get_settings()
|
|
6764
6774
|
"""
|
|
6765
6775
|
response = self._http_requests.get(self._settings_url)
|
|
6766
6776
|
response_json = response.json()
|
|
@@ -6810,9 +6820,9 @@ class Index(_BaseIndex):
|
|
|
6810
6820
|
>>> displayed_attributes=["title", "description", "genre", "release_date"],
|
|
6811
6821
|
>>> sortable_attributes=["title", "release_date"],
|
|
6812
6822
|
>>> )
|
|
6813
|
-
>>>
|
|
6814
|
-
>>>
|
|
6815
|
-
>>>
|
|
6823
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6824
|
+
>>> index = client.index("movies")
|
|
6825
|
+
>>> index.update_settings(new_settings)
|
|
6816
6826
|
"""
|
|
6817
6827
|
body_dict = {
|
|
6818
6828
|
k: v
|
|
@@ -6835,9 +6845,9 @@ class Index(_BaseIndex):
|
|
|
6835
6845
|
|
|
6836
6846
|
Examples
|
|
6837
6847
|
>>> from meilisearch_python_sdk import Client
|
|
6838
|
-
>>>
|
|
6839
|
-
>>>
|
|
6840
|
-
>>>
|
|
6848
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6849
|
+
>>> index = client.index("movies")
|
|
6850
|
+
>>> index.reset_settings()
|
|
6841
6851
|
"""
|
|
6842
6852
|
response = self._http_requests.delete(self._settings_url)
|
|
6843
6853
|
|
|
@@ -6855,9 +6865,9 @@ class Index(_BaseIndex):
|
|
|
6855
6865
|
|
|
6856
6866
|
Examples
|
|
6857
6867
|
>>> from meilisearch_python_sdk import Client
|
|
6858
|
-
>>>
|
|
6859
|
-
>>>
|
|
6860
|
-
>>>
|
|
6868
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6869
|
+
>>> index = client.index("movies")
|
|
6870
|
+
>>> ranking_rules = index.get_ranking_rules()
|
|
6861
6871
|
"""
|
|
6862
6872
|
response = self._http_requests.get(f"{self._settings_url}/ranking-rules")
|
|
6863
6873
|
|
|
@@ -6889,9 +6899,9 @@ class Index(_BaseIndex):
|
|
|
6889
6899
|
>>> "release_date:desc",
|
|
6890
6900
|
>>> "rank:desc",
|
|
6891
6901
|
>>> ],
|
|
6892
|
-
>>>
|
|
6893
|
-
>>>
|
|
6894
|
-
>>>
|
|
6902
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6903
|
+
>>> index = client.index("movies")
|
|
6904
|
+
>>> index.update_ranking_rules(ranking_rules)
|
|
6895
6905
|
"""
|
|
6896
6906
|
response = self._http_requests.put(
|
|
6897
6907
|
f"{self._settings_url}/ranking-rules", ranking_rules, compress=compress
|
|
@@ -6911,9 +6921,9 @@ class Index(_BaseIndex):
|
|
|
6911
6921
|
|
|
6912
6922
|
Examples
|
|
6913
6923
|
>>> from meilisearch_python_sdk import Client
|
|
6914
|
-
>>>
|
|
6915
|
-
>>>
|
|
6916
|
-
>>>
|
|
6924
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6925
|
+
>>> index = client.index("movies")
|
|
6926
|
+
>>> index.reset_ranking_rules()
|
|
6917
6927
|
"""
|
|
6918
6928
|
response = self._http_requests.delete(f"{self._settings_url}/ranking-rules")
|
|
6919
6929
|
|
|
@@ -6932,9 +6942,9 @@ class Index(_BaseIndex):
|
|
|
6932
6942
|
|
|
6933
6943
|
Examples
|
|
6934
6944
|
>>> from meilisearch_python_sdk import Client
|
|
6935
|
-
>>>
|
|
6936
|
-
>>>
|
|
6937
|
-
>>>
|
|
6945
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6946
|
+
>>> index = client.index("movies")
|
|
6947
|
+
>>> distinct_attribute = index.get_distinct_attribute()
|
|
6938
6948
|
"""
|
|
6939
6949
|
response = self._http_requests.get(f"{self._settings_url}/distinct-attribute")
|
|
6940
6950
|
|
|
@@ -6959,9 +6969,9 @@ class Index(_BaseIndex):
|
|
|
6959
6969
|
|
|
6960
6970
|
Examples
|
|
6961
6971
|
>>> from meilisearch_python_sdk import Client
|
|
6962
|
-
>>>
|
|
6963
|
-
>>>
|
|
6964
|
-
>>>
|
|
6972
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6973
|
+
>>> index = client.index("movies")
|
|
6974
|
+
>>> index.update_distinct_attribute("url")
|
|
6965
6975
|
"""
|
|
6966
6976
|
response = self._http_requests.put(
|
|
6967
6977
|
f"{self._settings_url}/distinct-attribute", body, compress=compress
|
|
@@ -6981,9 +6991,9 @@ class Index(_BaseIndex):
|
|
|
6981
6991
|
|
|
6982
6992
|
Examples
|
|
6983
6993
|
>>> from meilisearch_python_sdk import Client
|
|
6984
|
-
>>>
|
|
6985
|
-
>>>
|
|
6986
|
-
>>>
|
|
6994
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
6995
|
+
>>> index = client.index("movies")
|
|
6996
|
+
>>> index.reset_distinct_attributes()
|
|
6987
6997
|
"""
|
|
6988
6998
|
response = self._http_requests.delete(f"{self._settings_url}/distinct-attribute")
|
|
6989
6999
|
|
|
@@ -7001,9 +7011,9 @@ class Index(_BaseIndex):
|
|
|
7001
7011
|
|
|
7002
7012
|
Examples
|
|
7003
7013
|
>>> from meilisearch_python_sdk import Client
|
|
7004
|
-
>>>
|
|
7005
|
-
>>>
|
|
7006
|
-
>>>
|
|
7014
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7015
|
+
>>> index = client.index("movies")
|
|
7016
|
+
>>> searchable_attributes = index.get_searchable_attributes()
|
|
7007
7017
|
"""
|
|
7008
7018
|
response = self._http_requests.get(f"{self._settings_url}/searchable-attributes")
|
|
7009
7019
|
|
|
@@ -7025,9 +7035,9 @@ class Index(_BaseIndex):
|
|
|
7025
7035
|
|
|
7026
7036
|
Examples
|
|
7027
7037
|
>>> from meilisearch_python_sdk import Client
|
|
7028
|
-
>>>
|
|
7029
|
-
>>>
|
|
7030
|
-
>>>
|
|
7038
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7039
|
+
>>> index = client.index("movies")
|
|
7040
|
+
>>> index.update_searchable_attributes(["title", "description", "genre"])
|
|
7031
7041
|
"""
|
|
7032
7042
|
response = self._http_requests.put(
|
|
7033
7043
|
f"{self._settings_url}/searchable-attributes", body, compress=compress
|
|
@@ -7047,9 +7057,9 @@ class Index(_BaseIndex):
|
|
|
7047
7057
|
|
|
7048
7058
|
Examples
|
|
7049
7059
|
>>> from meilisearch_python_sdk import Client
|
|
7050
|
-
>>>
|
|
7051
|
-
>>>
|
|
7052
|
-
>>>
|
|
7060
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7061
|
+
>>> index = client.index("movies")
|
|
7062
|
+
>>> index.reset_searchable_attributes()
|
|
7053
7063
|
"""
|
|
7054
7064
|
response = self._http_requests.delete(f"{self._settings_url}/searchable-attributes")
|
|
7055
7065
|
|
|
@@ -7067,9 +7077,9 @@ class Index(_BaseIndex):
|
|
|
7067
7077
|
|
|
7068
7078
|
Examples
|
|
7069
7079
|
>>> from meilisearch_python_sdk import Client
|
|
7070
|
-
>>>
|
|
7071
|
-
>>>
|
|
7072
|
-
>>>
|
|
7080
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7081
|
+
>>> index = client.index("movies")
|
|
7082
|
+
>>> displayed_attributes = index.get_displayed_attributes()
|
|
7073
7083
|
"""
|
|
7074
7084
|
response = self._http_requests.get(f"{self._settings_url}/displayed-attributes")
|
|
7075
7085
|
|
|
@@ -7091,11 +7101,11 @@ class Index(_BaseIndex):
|
|
|
7091
7101
|
|
|
7092
7102
|
Examples
|
|
7093
7103
|
>>> from meilisearch_python_sdk import Client
|
|
7094
|
-
>>>
|
|
7095
|
-
>>>
|
|
7096
|
-
>>>
|
|
7097
|
-
>>>
|
|
7098
|
-
>>>
|
|
7104
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7105
|
+
>>> index = client.index("movies")
|
|
7106
|
+
>>> index.update_displayed_attributes(
|
|
7107
|
+
>>> ["title", "description", "genre", "release_date"]
|
|
7108
|
+
>>> )
|
|
7099
7109
|
"""
|
|
7100
7110
|
response = self._http_requests.put(
|
|
7101
7111
|
f"{self._settings_url}/displayed-attributes", body, compress=compress
|
|
@@ -7115,9 +7125,9 @@ class Index(_BaseIndex):
|
|
|
7115
7125
|
|
|
7116
7126
|
Examples
|
|
7117
7127
|
>>> from meilisearch_python_sdk import Client
|
|
7118
|
-
>>>
|
|
7119
|
-
>>>
|
|
7120
|
-
>>>
|
|
7128
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7129
|
+
>>> index = client.index("movies")
|
|
7130
|
+
>>> index.reset_displayed_attributes()
|
|
7121
7131
|
"""
|
|
7122
7132
|
response = self._http_requests.delete(f"{self._settings_url}/displayed-attributes")
|
|
7123
7133
|
|
|
@@ -7135,9 +7145,9 @@ class Index(_BaseIndex):
|
|
|
7135
7145
|
|
|
7136
7146
|
Examples
|
|
7137
7147
|
>>> from meilisearch_python_sdk import Client
|
|
7138
|
-
>>>
|
|
7139
|
-
>>>
|
|
7140
|
-
>>>
|
|
7148
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7149
|
+
>>> index = client.index("movies")
|
|
7150
|
+
>>> stop_words = index.get_stop_words()
|
|
7141
7151
|
"""
|
|
7142
7152
|
response = self._http_requests.get(f"{self._settings_url}/stop-words")
|
|
7143
7153
|
|
|
@@ -7162,9 +7172,9 @@ class Index(_BaseIndex):
|
|
|
7162
7172
|
|
|
7163
7173
|
Examples
|
|
7164
7174
|
>>> from meilisearch_python_sdk import Client
|
|
7165
|
-
>>>
|
|
7166
|
-
>>>
|
|
7167
|
-
>>>
|
|
7175
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7176
|
+
>>> index = client.index("movies")
|
|
7177
|
+
>>> index.update_stop_words(["the", "a", "an"])
|
|
7168
7178
|
"""
|
|
7169
7179
|
response = self._http_requests.put(
|
|
7170
7180
|
f"{self._settings_url}/stop-words", body, compress=compress
|
|
@@ -7184,9 +7194,9 @@ class Index(_BaseIndex):
|
|
|
7184
7194
|
|
|
7185
7195
|
Examples
|
|
7186
7196
|
>>> from meilisearch_python_sdk import Client
|
|
7187
|
-
>>>
|
|
7188
|
-
>>>
|
|
7189
|
-
>>>
|
|
7197
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7198
|
+
>>> index = client.index("movies")
|
|
7199
|
+
>>> index.reset_stop_words()
|
|
7190
7200
|
"""
|
|
7191
7201
|
response = self._http_requests.delete(f"{self._settings_url}/stop-words")
|
|
7192
7202
|
|
|
@@ -7204,9 +7214,9 @@ class Index(_BaseIndex):
|
|
|
7204
7214
|
|
|
7205
7215
|
Examples
|
|
7206
7216
|
>>> from meilisearch_python_sdk import Client
|
|
7207
|
-
>>>
|
|
7208
|
-
>>>
|
|
7209
|
-
>>>
|
|
7217
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7218
|
+
>>> index = client.index("movies")
|
|
7219
|
+
>>> synonyms = index.get_synonyms()
|
|
7210
7220
|
"""
|
|
7211
7221
|
response = self._http_requests.get(f"{self._settings_url}/synonyms")
|
|
7212
7222
|
|
|
@@ -7230,11 +7240,11 @@ class Index(_BaseIndex):
|
|
|
7230
7240
|
|
|
7231
7241
|
Examples
|
|
7232
7242
|
>>> from meilisearch_python_sdk import Client
|
|
7233
|
-
>>>
|
|
7234
|
-
>>>
|
|
7235
|
-
>>>
|
|
7236
|
-
>>>
|
|
7237
|
-
>>>
|
|
7243
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7244
|
+
>>> index = client.index("movies")
|
|
7245
|
+
>>> index.update_synonyms(
|
|
7246
|
+
>>> {"wolverine": ["xmen", "logan"], "logan": ["wolverine"]}
|
|
7247
|
+
>>> )
|
|
7238
7248
|
"""
|
|
7239
7249
|
response = self._http_requests.put(
|
|
7240
7250
|
f"{self._settings_url}/synonyms", body, compress=compress
|
|
@@ -7254,9 +7264,9 @@ class Index(_BaseIndex):
|
|
|
7254
7264
|
|
|
7255
7265
|
Examples
|
|
7256
7266
|
>>> from meilisearch_python_sdk import Client
|
|
7257
|
-
>>>
|
|
7258
|
-
>>>
|
|
7259
|
-
>>>
|
|
7267
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7268
|
+
>>> index = client.index("movies")
|
|
7269
|
+
>>> index.reset_synonyms()
|
|
7260
7270
|
"""
|
|
7261
7271
|
response = self._http_requests.delete(f"{self._settings_url}/synonyms")
|
|
7262
7272
|
|
|
@@ -7274,9 +7284,9 @@ class Index(_BaseIndex):
|
|
|
7274
7284
|
|
|
7275
7285
|
Examples
|
|
7276
7286
|
>>> from meilisearch_python_sdk import Client
|
|
7277
|
-
>>>
|
|
7278
|
-
>>>
|
|
7279
|
-
>>>
|
|
7287
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7288
|
+
>>> index = client.index("movies")
|
|
7289
|
+
>>> filterable_attributes = index.get_filterable_attributes()
|
|
7280
7290
|
"""
|
|
7281
7291
|
response = self._http_requests.get(f"{self._settings_url}/filterable-attributes")
|
|
7282
7292
|
|
|
@@ -7317,9 +7327,9 @@ class Index(_BaseIndex):
|
|
|
7317
7327
|
|
|
7318
7328
|
Examples
|
|
7319
7329
|
>>> from meilisearch_python_sdk import Client
|
|
7320
|
-
>>>
|
|
7321
|
-
>>>
|
|
7322
|
-
>>>
|
|
7330
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7331
|
+
>>> index = client.index("movies")
|
|
7332
|
+
>>> index.update_filterable_attributes(["genre", "director"])
|
|
7323
7333
|
"""
|
|
7324
7334
|
payload: list[str | JsonDict] = []
|
|
7325
7335
|
|
|
@@ -7347,9 +7357,9 @@ class Index(_BaseIndex):
|
|
|
7347
7357
|
|
|
7348
7358
|
Examples
|
|
7349
7359
|
>>> from meilisearch_python_sdk import Client
|
|
7350
|
-
>>>
|
|
7351
|
-
>>>
|
|
7352
|
-
>>>
|
|
7360
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7361
|
+
>>> index = client.index("movies")
|
|
7362
|
+
>>> index.reset_filterable_attributes()
|
|
7353
7363
|
"""
|
|
7354
7364
|
response = self._http_requests.delete(f"{self._settings_url}/filterable-attributes")
|
|
7355
7365
|
|
|
@@ -7367,9 +7377,9 @@ class Index(_BaseIndex):
|
|
|
7367
7377
|
|
|
7368
7378
|
Examples
|
|
7369
7379
|
>>> from meilisearch_python_sdk import Client
|
|
7370
|
-
>>>
|
|
7371
|
-
>>>
|
|
7372
|
-
>>>
|
|
7380
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7381
|
+
>>> index = client.index("movies")
|
|
7382
|
+
>>> sortable_attributes = index.get_sortable_attributes()
|
|
7373
7383
|
"""
|
|
7374
7384
|
response = self._http_requests.get(f"{self._settings_url}/sortable-attributes")
|
|
7375
7385
|
|
|
@@ -7393,9 +7403,9 @@ class Index(_BaseIndex):
|
|
|
7393
7403
|
|
|
7394
7404
|
Examples
|
|
7395
7405
|
>>> from meilisearch_python_sdk import Client
|
|
7396
|
-
>>>
|
|
7397
|
-
>>>
|
|
7398
|
-
>>>
|
|
7406
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7407
|
+
>>> index = client.index("movies")
|
|
7408
|
+
>>> index.update_sortable_attributes(["title", "release_date"])
|
|
7399
7409
|
"""
|
|
7400
7410
|
response = self._http_requests.put(
|
|
7401
7411
|
f"{self._settings_url}/sortable-attributes", sortable_attributes, compress=compress
|
|
@@ -7415,9 +7425,9 @@ class Index(_BaseIndex):
|
|
|
7415
7425
|
|
|
7416
7426
|
Examples
|
|
7417
7427
|
>>> from meilisearch_python_sdk import Client
|
|
7418
|
-
>>>
|
|
7419
|
-
>>>
|
|
7420
|
-
>>>
|
|
7428
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7429
|
+
>>> index = client.index("movies")
|
|
7430
|
+
>>> index.reset_sortable_attributes()
|
|
7421
7431
|
"""
|
|
7422
7432
|
response = self._http_requests.delete(f"{self._settings_url}/sortable-attributes")
|
|
7423
7433
|
|
|
@@ -7435,9 +7445,9 @@ class Index(_BaseIndex):
|
|
|
7435
7445
|
|
|
7436
7446
|
Examples
|
|
7437
7447
|
>>> from meilisearch_python_sdk import Client
|
|
7438
|
-
>>>
|
|
7439
|
-
>>>
|
|
7440
|
-
>>>
|
|
7448
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7449
|
+
>>> index = client.index("movies")
|
|
7450
|
+
>>> sortable_attributes = index.get_typo_tolerance()
|
|
7441
7451
|
"""
|
|
7442
7452
|
response = self._http_requests.get(f"{self._settings_url}/typo-tolerance")
|
|
7443
7453
|
|
|
@@ -7461,10 +7471,10 @@ class Index(_BaseIndex):
|
|
|
7461
7471
|
|
|
7462
7472
|
Examples
|
|
7463
7473
|
>>> from meilisearch_python_sdk import Client
|
|
7464
|
-
>>>
|
|
7465
|
-
>>>
|
|
7466
|
-
>>>
|
|
7467
|
-
>>>
|
|
7474
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7475
|
+
>>> index = client.index("movies")
|
|
7476
|
+
>>> TypoTolerance(enabled=False)
|
|
7477
|
+
>>> index.update_typo_tolerance()
|
|
7468
7478
|
"""
|
|
7469
7479
|
response = self._http_requests.patch(
|
|
7470
7480
|
f"{self._settings_url}/typo-tolerance",
|
|
@@ -7486,9 +7496,9 @@ class Index(_BaseIndex):
|
|
|
7486
7496
|
|
|
7487
7497
|
Examples
|
|
7488
7498
|
>>> from meilisearch_python_sdk import Client
|
|
7489
|
-
>>>
|
|
7490
|
-
>>>
|
|
7491
|
-
>>>
|
|
7499
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7500
|
+
>>> index = client.index("movies")
|
|
7501
|
+
>>> index.reset_typo_tolerance()
|
|
7492
7502
|
"""
|
|
7493
7503
|
response = self._http_requests.delete(f"{self._settings_url}/typo-tolerance")
|
|
7494
7504
|
|
|
@@ -7506,9 +7516,9 @@ class Index(_BaseIndex):
|
|
|
7506
7516
|
|
|
7507
7517
|
Examples
|
|
7508
7518
|
>>> from meilisearch_python_sdk import Client
|
|
7509
|
-
>>>
|
|
7510
|
-
>>>
|
|
7511
|
-
>>>
|
|
7519
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7520
|
+
>>> index = client.index("movies")
|
|
7521
|
+
>>> faceting = index.get_faceting()
|
|
7512
7522
|
"""
|
|
7513
7523
|
response = self._http_requests.get(f"{self._settings_url}/faceting")
|
|
7514
7524
|
|
|
@@ -7530,9 +7540,9 @@ class Index(_BaseIndex):
|
|
|
7530
7540
|
|
|
7531
7541
|
Examples
|
|
7532
7542
|
>>> from meilisearch_python_sdk import Client
|
|
7533
|
-
>>>
|
|
7534
|
-
>>>
|
|
7535
|
-
>>>
|
|
7543
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7544
|
+
>>> index = client.index("movies")
|
|
7545
|
+
>>> index.update_faceting(faceting=Faceting(max_values_per_facet=100))
|
|
7536
7546
|
"""
|
|
7537
7547
|
response = self._http_requests.patch(
|
|
7538
7548
|
f"{self._settings_url}/faceting",
|
|
@@ -7554,9 +7564,9 @@ class Index(_BaseIndex):
|
|
|
7554
7564
|
|
|
7555
7565
|
Examples
|
|
7556
7566
|
>>> from meilisearch_python_sdk import Client
|
|
7557
|
-
>>>
|
|
7558
|
-
>>>
|
|
7559
|
-
>>>
|
|
7567
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7568
|
+
>>> index = client.index("movies")
|
|
7569
|
+
>>> index.reset_faceting()
|
|
7560
7570
|
"""
|
|
7561
7571
|
response = self._http_requests.delete(f"{self._settings_url}/faceting")
|
|
7562
7572
|
|
|
@@ -7574,9 +7584,9 @@ class Index(_BaseIndex):
|
|
|
7574
7584
|
|
|
7575
7585
|
Examples
|
|
7576
7586
|
>>> from meilisearch_async_client import Client
|
|
7577
|
-
>>>
|
|
7578
|
-
>>>
|
|
7579
|
-
>>>
|
|
7587
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7588
|
+
>>> index = client.index("movies")
|
|
7589
|
+
>>> pagination_settings = index.get_pagination()
|
|
7580
7590
|
"""
|
|
7581
7591
|
response = self._http_requests.get(f"{self._settings_url}/pagination")
|
|
7582
7592
|
|
|
@@ -7599,9 +7609,9 @@ class Index(_BaseIndex):
|
|
|
7599
7609
|
Examples
|
|
7600
7610
|
>>> from meilisearch_python_sdk import Client
|
|
7601
7611
|
>>> from meilisearch_python_sdk.models.settings import Pagination
|
|
7602
|
-
>>>
|
|
7603
|
-
>>>
|
|
7604
|
-
>>>
|
|
7612
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7613
|
+
>>> index = client.index("movies")
|
|
7614
|
+
>>> index.update_pagination(settings=Pagination(max_total_hits=123))
|
|
7605
7615
|
"""
|
|
7606
7616
|
response = self._http_requests.patch(
|
|
7607
7617
|
f"{self._settings_url}/pagination",
|
|
@@ -7623,9 +7633,9 @@ class Index(_BaseIndex):
|
|
|
7623
7633
|
|
|
7624
7634
|
Examples
|
|
7625
7635
|
>>> from meilisearch_async_client import Client
|
|
7626
|
-
>>>
|
|
7627
|
-
>>>
|
|
7628
|
-
>>>
|
|
7636
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7637
|
+
>>> index = client.index("movies")
|
|
7638
|
+
>>> index.reset_pagination()
|
|
7629
7639
|
"""
|
|
7630
7640
|
response = self._http_requests.delete(f"{self._settings_url}/pagination")
|
|
7631
7641
|
|
|
@@ -7643,9 +7653,9 @@ class Index(_BaseIndex):
|
|
|
7643
7653
|
|
|
7644
7654
|
Examples
|
|
7645
7655
|
>>> from meilisearch_async_client import Client
|
|
7646
|
-
>>>
|
|
7647
|
-
>>>
|
|
7648
|
-
>>>
|
|
7656
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7657
|
+
>>> index = client.index("movies")
|
|
7658
|
+
>>> separator_token_settings = index.get_separator_tokens()
|
|
7649
7659
|
"""
|
|
7650
7660
|
response = self._http_requests.get(f"{self._settings_url}/separator-tokens")
|
|
7651
7661
|
|
|
@@ -7669,9 +7679,9 @@ class Index(_BaseIndex):
|
|
|
7669
7679
|
|
|
7670
7680
|
Examples
|
|
7671
7681
|
>>> from meilisearch_python_sdk import Client
|
|
7672
|
-
>>>
|
|
7673
|
-
>>>
|
|
7674
|
-
>>>
|
|
7682
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7683
|
+
>>> index = client.index("movies")
|
|
7684
|
+
>>> index.update_separator_tokens(separator_tokenes=["|", "/")
|
|
7675
7685
|
"""
|
|
7676
7686
|
response = self._http_requests.put(
|
|
7677
7687
|
f"{self._settings_url}/separator-tokens", separator_tokens, compress=compress
|
|
@@ -7691,9 +7701,9 @@ class Index(_BaseIndex):
|
|
|
7691
7701
|
|
|
7692
7702
|
Examples
|
|
7693
7703
|
>>> from meilisearch_async_client import Client
|
|
7694
|
-
>>>
|
|
7695
|
-
>>>
|
|
7696
|
-
>>>
|
|
7704
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7705
|
+
>>> index = client.index("movies")
|
|
7706
|
+
>>> index.reset_separator_tokens()
|
|
7697
7707
|
"""
|
|
7698
7708
|
response = self._http_requests.delete(f"{self._settings_url}/separator-tokens")
|
|
7699
7709
|
|
|
@@ -7711,9 +7721,9 @@ class Index(_BaseIndex):
|
|
|
7711
7721
|
|
|
7712
7722
|
Examples
|
|
7713
7723
|
>>> from meilisearch_async_client import Client
|
|
7714
|
-
>>>
|
|
7715
|
-
>>>
|
|
7716
|
-
>>>
|
|
7724
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7725
|
+
>>> index = client.index("movies")
|
|
7726
|
+
>>> non_separator_token_settings = index.get_non_separator_tokens()
|
|
7717
7727
|
"""
|
|
7718
7728
|
response = self._http_requests.get(f"{self._settings_url}/non-separator-tokens")
|
|
7719
7729
|
|
|
@@ -7737,9 +7747,9 @@ class Index(_BaseIndex):
|
|
|
7737
7747
|
|
|
7738
7748
|
Examples
|
|
7739
7749
|
>>> from meilisearch_python_sdk import Client
|
|
7740
|
-
>>>
|
|
7741
|
-
>>>
|
|
7742
|
-
>>>
|
|
7750
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7751
|
+
>>> index = client.index("movies")
|
|
7752
|
+
>>> index.update_non_separator_tokens(non_separator_tokens=["@", "#")
|
|
7743
7753
|
"""
|
|
7744
7754
|
response = self._http_requests.put(
|
|
7745
7755
|
f"{self._settings_url}/non-separator-tokens", non_separator_tokens, compress=compress
|
|
@@ -7759,9 +7769,9 @@ class Index(_BaseIndex):
|
|
|
7759
7769
|
|
|
7760
7770
|
Examples
|
|
7761
7771
|
>>> from meilisearch_async_client import Client
|
|
7762
|
-
>>>
|
|
7763
|
-
>>>
|
|
7764
|
-
>>>
|
|
7772
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7773
|
+
>>> index = client.index("movies")
|
|
7774
|
+
>>> index.reset_non_separator_tokens()
|
|
7765
7775
|
"""
|
|
7766
7776
|
response = self._http_requests.delete(f"{self._settings_url}/non-separator-tokens")
|
|
7767
7777
|
|
|
@@ -7779,9 +7789,9 @@ class Index(_BaseIndex):
|
|
|
7779
7789
|
|
|
7780
7790
|
Examples
|
|
7781
7791
|
>>> from meilisearch_async_client import Client
|
|
7782
|
-
>>>
|
|
7783
|
-
>>>
|
|
7784
|
-
>>>
|
|
7792
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7793
|
+
>>> index = client.index("movies")
|
|
7794
|
+
>>> search_cutoff_ms_settings = index.get_search_cutoff_ms()
|
|
7785
7795
|
"""
|
|
7786
7796
|
response = self._http_requests.get(f"{self._settings_url}/search-cutoff-ms")
|
|
7787
7797
|
|
|
@@ -7803,9 +7813,9 @@ class Index(_BaseIndex):
|
|
|
7803
7813
|
|
|
7804
7814
|
Examples
|
|
7805
7815
|
>>> from meilisearch_python_sdk import Client
|
|
7806
|
-
>>>
|
|
7807
|
-
>>>
|
|
7808
|
-
>>>
|
|
7816
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7817
|
+
>>> index = client.index("movies")
|
|
7818
|
+
>>> index.update_search_cutoff_ms(100)
|
|
7809
7819
|
"""
|
|
7810
7820
|
response = self._http_requests.put(
|
|
7811
7821
|
f"{self._settings_url}/search-cutoff-ms", search_cutoff_ms, compress=compress
|
|
@@ -7825,9 +7835,9 @@ class Index(_BaseIndex):
|
|
|
7825
7835
|
|
|
7826
7836
|
Examples
|
|
7827
7837
|
>>> from meilisearch_async_client import Client
|
|
7828
|
-
>>>
|
|
7829
|
-
>>>
|
|
7830
|
-
>>>
|
|
7838
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7839
|
+
>>> index = client.index("movies")
|
|
7840
|
+
>>> index.reset_search_cutoff_ms()
|
|
7831
7841
|
"""
|
|
7832
7842
|
response = self._http_requests.delete(f"{self._settings_url}/search-cutoff-ms")
|
|
7833
7843
|
|
|
@@ -7845,9 +7855,9 @@ class Index(_BaseIndex):
|
|
|
7845
7855
|
|
|
7846
7856
|
Examples
|
|
7847
7857
|
>>> from meilisearch_async_client import Client
|
|
7848
|
-
>>>
|
|
7849
|
-
>>>
|
|
7850
|
-
>>>
|
|
7858
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7859
|
+
>>> index = client.index("movies")
|
|
7860
|
+
>>> word_dictionary = index.get_word_dictionary()
|
|
7851
7861
|
"""
|
|
7852
7862
|
response = self._http_requests.get(f"{self._settings_url}/dictionary")
|
|
7853
7863
|
|
|
@@ -7869,9 +7879,9 @@ class Index(_BaseIndex):
|
|
|
7869
7879
|
|
|
7870
7880
|
Examples
|
|
7871
7881
|
>>> from meilisearch_python_sdk import Client
|
|
7872
|
-
>>>
|
|
7873
|
-
>>>
|
|
7874
|
-
>>>
|
|
7882
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7883
|
+
>>> index = client.index("movies")
|
|
7884
|
+
>>> index.update_word_dictionary(dictionary=["S.O.S", "S.O")
|
|
7875
7885
|
"""
|
|
7876
7886
|
response = self._http_requests.put(
|
|
7877
7887
|
f"{self._settings_url}/dictionary", dictionary, compress=compress
|
|
@@ -7891,9 +7901,9 @@ class Index(_BaseIndex):
|
|
|
7891
7901
|
|
|
7892
7902
|
Examples
|
|
7893
7903
|
>>> from meilisearch_async_client import Client
|
|
7894
|
-
>>>
|
|
7895
|
-
>>>
|
|
7896
|
-
>>>
|
|
7904
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7905
|
+
>>> index = client.index("movies")
|
|
7906
|
+
>>> index.reset_word_dictionary()
|
|
7897
7907
|
"""
|
|
7898
7908
|
response = self._http_requests.delete(f"{self._settings_url}/dictionary")
|
|
7899
7909
|
|
|
@@ -7911,9 +7921,9 @@ class Index(_BaseIndex):
|
|
|
7911
7921
|
|
|
7912
7922
|
Examples
|
|
7913
7923
|
>>> from meilisearch_async_client import Client
|
|
7914
|
-
>>>
|
|
7915
|
-
>>>
|
|
7916
|
-
>>>
|
|
7924
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7925
|
+
>>> index = client.index("movies")
|
|
7926
|
+
>>> proximity_precision = index.get_proximity_precision()
|
|
7917
7927
|
"""
|
|
7918
7928
|
response = self._http_requests.get(f"{self._settings_url}/proximity-precision")
|
|
7919
7929
|
|
|
@@ -7938,9 +7948,9 @@ class Index(_BaseIndex):
|
|
|
7938
7948
|
Examples
|
|
7939
7949
|
>>> from meilisearch_python_sdk import Client
|
|
7940
7950
|
>>> from meilisearch_python_sdk.models.settings import ProximityPrecision
|
|
7941
|
-
>>>
|
|
7942
|
-
>>>
|
|
7943
|
-
>>>
|
|
7951
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7952
|
+
>>> index = client.index("movies")
|
|
7953
|
+
>>> index.update_proximity_precision(ProximityPrecision.BY_ATTRIBUTE)
|
|
7944
7954
|
"""
|
|
7945
7955
|
response = self._http_requests.put(
|
|
7946
7956
|
f"{self._settings_url}/proximity-precision",
|
|
@@ -7962,9 +7972,9 @@ class Index(_BaseIndex):
|
|
|
7962
7972
|
|
|
7963
7973
|
Examples
|
|
7964
7974
|
>>> from meilisearch_async_client import Client
|
|
7965
|
-
>>>
|
|
7966
|
-
>>>
|
|
7967
|
-
>>>
|
|
7975
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7976
|
+
>>> index = client.index("movies")
|
|
7977
|
+
>>> index.reset_proximity_precision()
|
|
7968
7978
|
"""
|
|
7969
7979
|
response = self._http_requests.delete(f"{self._settings_url}/proximity-precision")
|
|
7970
7980
|
|
|
@@ -7982,9 +7992,9 @@ class Index(_BaseIndex):
|
|
|
7982
7992
|
|
|
7983
7993
|
Examples
|
|
7984
7994
|
>>> from meilisearch_async_client import Client
|
|
7985
|
-
>>>
|
|
7986
|
-
>>>
|
|
7987
|
-
>>>
|
|
7995
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
7996
|
+
>>> index = client.index("movies")
|
|
7997
|
+
>>> embedders = await index.get_embedders()
|
|
7988
7998
|
"""
|
|
7989
7999
|
response = self._http_requests.get(f"{self._settings_url}/embedders")
|
|
7990
8000
|
|
|
@@ -8007,11 +8017,11 @@ class Index(_BaseIndex):
|
|
|
8007
8017
|
Examples
|
|
8008
8018
|
>>> from meilisearch_python_sdk import Client
|
|
8009
8019
|
>>> from meilisearch_python_sdk.models.settings import Embedders, UserProvidedEmbedder
|
|
8010
|
-
>>>
|
|
8011
|
-
>>>
|
|
8012
|
-
>>>
|
|
8013
|
-
>>>
|
|
8014
|
-
>>>
|
|
8020
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8021
|
+
>>> index = client.index("movies")
|
|
8022
|
+
>>> index.update_embedders(
|
|
8023
|
+
>>> Embedders(embedders={dimensions=512)})
|
|
8024
|
+
>>> )
|
|
8015
8025
|
"""
|
|
8016
8026
|
payload = {}
|
|
8017
8027
|
for key, embedder in embedders.embedders.items():
|
|
@@ -8040,9 +8050,9 @@ class Index(_BaseIndex):
|
|
|
8040
8050
|
|
|
8041
8051
|
Examples
|
|
8042
8052
|
>>> from meilisearch_async_client import Client
|
|
8043
|
-
>>>
|
|
8044
|
-
>>>
|
|
8045
|
-
>>>
|
|
8053
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8054
|
+
>>> index = client.index("movies")
|
|
8055
|
+
>>> index.reset_embedders()
|
|
8046
8056
|
"""
|
|
8047
8057
|
response = self._http_requests.delete(f"{self._settings_url}/embedders")
|
|
8048
8058
|
|
|
@@ -8060,9 +8070,9 @@ class Index(_BaseIndex):
|
|
|
8060
8070
|
|
|
8061
8071
|
Examples
|
|
8062
8072
|
>>> from meilisearch_async_client import AsyncClient
|
|
8063
|
-
>>>
|
|
8064
|
-
>>>
|
|
8065
|
-
>>>
|
|
8073
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8074
|
+
>>> index = client.index("movies")
|
|
8075
|
+
>>> localized_attributes = await index.get_localized_attributes()
|
|
8066
8076
|
"""
|
|
8067
8077
|
response = self._http_requests.get(f"{self._settings_url}/localized-attributes")
|
|
8068
8078
|
|
|
@@ -8092,12 +8102,12 @@ class Index(_BaseIndex):
|
|
|
8092
8102
|
>>> from meilisearch_python_sdk.models.settings import LocalizedAttributes
|
|
8093
8103
|
>>>
|
|
8094
8104
|
>>>
|
|
8095
|
-
>>>
|
|
8096
|
-
>>>
|
|
8097
|
-
>>>
|
|
8098
|
-
>>>
|
|
8099
|
-
>>>
|
|
8100
|
-
>>>
|
|
8105
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8106
|
+
>>> index = client.index("movies")
|
|
8107
|
+
>>> index.update_localized_attributes([
|
|
8108
|
+
>>> LocalizedAttributes(locales=["eng", "spa"], attribute_patterns=["*"]),
|
|
8109
|
+
>>> LocalizedAttributes(locales=["ita"], attribute_patterns=["*_it"]),
|
|
8110
|
+
>>> ])
|
|
8101
8111
|
"""
|
|
8102
8112
|
payload = [x.model_dump(by_alias=True) for x in localized_attributes]
|
|
8103
8113
|
response = self._http_requests.put(
|
|
@@ -8138,9 +8148,9 @@ class Index(_BaseIndex):
|
|
|
8138
8148
|
|
|
8139
8149
|
Examples
|
|
8140
8150
|
>>> from meilisearch_async_client import Client
|
|
8141
|
-
>>>
|
|
8142
|
-
>>>
|
|
8143
|
-
>>>
|
|
8151
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8152
|
+
>>> index = client.index("movies")
|
|
8153
|
+
>>> facet_search = await index.get_facet_search()
|
|
8144
8154
|
"""
|
|
8145
8155
|
response = self._http_requests.get(f"{self._settings_url}/facet-search")
|
|
8146
8156
|
|
|
@@ -8162,9 +8172,9 @@ class Index(_BaseIndex):
|
|
|
8162
8172
|
|
|
8163
8173
|
Examples
|
|
8164
8174
|
>>> from meilisearch_python_sdk import Client
|
|
8165
|
-
>>>
|
|
8166
|
-
>>>
|
|
8167
|
-
>>>
|
|
8175
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8176
|
+
>>> index = client.index("movies")
|
|
8177
|
+
>>> index.update_facet_search(True)
|
|
8168
8178
|
"""
|
|
8169
8179
|
response = self._http_requests.put(
|
|
8170
8180
|
f"{self._settings_url}/facet-search",
|
|
@@ -8186,9 +8196,9 @@ class Index(_BaseIndex):
|
|
|
8186
8196
|
|
|
8187
8197
|
Examples
|
|
8188
8198
|
>>> from meilisearch_async_client import Client
|
|
8189
|
-
>>>
|
|
8190
|
-
>>>
|
|
8191
|
-
>>>
|
|
8199
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8200
|
+
>>> index = client.index("movies")
|
|
8201
|
+
>>> await index.reset_facet_search()
|
|
8192
8202
|
"""
|
|
8193
8203
|
response = self._http_requests.delete(f"{self._settings_url}/facet-search")
|
|
8194
8204
|
|
|
@@ -8206,9 +8216,9 @@ class Index(_BaseIndex):
|
|
|
8206
8216
|
|
|
8207
8217
|
Examples
|
|
8208
8218
|
>>> from meilisearch_async_client import Client
|
|
8209
|
-
>>>
|
|
8210
|
-
>>>
|
|
8211
|
-
>>>
|
|
8219
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8220
|
+
>>> index = client.index("movies")
|
|
8221
|
+
>>> prefix_search = index.get_prefix_search()
|
|
8212
8222
|
"""
|
|
8213
8223
|
response = self._http_requests.get(f"{self._settings_url}/prefix-search")
|
|
8214
8224
|
|
|
@@ -8235,9 +8245,9 @@ class Index(_BaseIndex):
|
|
|
8235
8245
|
|
|
8236
8246
|
Examples
|
|
8237
8247
|
>>> from meilisearch_python_sdk import Client
|
|
8238
|
-
>>>
|
|
8239
|
-
>>>
|
|
8240
|
-
>>>
|
|
8248
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8249
|
+
>>> index = client.index("movies")
|
|
8250
|
+
>>> index.update_prefix_search("disabled")
|
|
8241
8251
|
"""
|
|
8242
8252
|
response = self._http_requests.put(
|
|
8243
8253
|
f"{self._settings_url}/prefix-search",
|
|
@@ -8259,9 +8269,9 @@ class Index(_BaseIndex):
|
|
|
8259
8269
|
|
|
8260
8270
|
Examples
|
|
8261
8271
|
>>> from meilisearch_async_client import Client
|
|
8262
|
-
>>>
|
|
8263
|
-
>>>
|
|
8264
|
-
>>>
|
|
8272
|
+
>>> with Client("http://localhost.com", "masterKey") as client:
|
|
8273
|
+
>>> index = client.index("movies")
|
|
8274
|
+
>>> index.reset_prefix_search()
|
|
8265
8275
|
"""
|
|
8266
8276
|
response = self._http_requests.delete(f"{self._settings_url}/prefix-search")
|
|
8267
8277
|
|