You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Options passed during index creation (ex: primaryKey)
35
+
UID of the index.
36
+
options (optional): dict
37
+
Options passed during index creation (ex: primaryKey).
38
38
39
39
Returns
40
40
-------
41
41
index : Index
42
-
an instance of Index containing the information of the newly created index
42
+
An instance of Index containing the information of the newly created index.
43
+
43
44
Raises
44
45
------
45
-
HTTPError
46
-
In case of any other error found here https://docs.meilisearch.com/references/#errors-status-code
46
+
MeiliSearchApiError
47
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
47
48
"""
48
49
returnIndex.create(self.config, uid, options)
49
50
50
51
defget_indexes(self):
51
52
"""Get all indexes.
52
53
53
-
Raises
54
-
------
55
-
HTTPError
56
-
In case of any error found here https://docs.meilisearch.com/references/#errors-status-code
57
54
Returns
58
55
-------
59
-
list
60
-
List of indexes in dictionnary format. (e.g [{ 'uid': 'movies' 'primaryKey': 'objectID' }])
56
+
indexes: list
57
+
List of indexes in dictionary format. (e.g [{ 'uid': 'movies' 'primaryKey': 'objectID' }])
58
+
59
+
Raises
60
+
------
61
+
MeiliSearchApiError
62
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
61
63
"""
62
64
returnself.http.get(self.config.paths.index)
63
65
@@ -70,20 +72,21 @@ def get_index(self, uid):
70
72
uid: str
71
73
UID of the index.
72
74
73
-
Raises
74
-
------
75
-
HTTPError
76
-
In case of any error found here https://docs.meilisearch.com/references/#errors-status-code
77
75
Returns
78
76
-------
79
77
index : Index
80
78
An Index instance containing the information of the fetched index.
79
+
80
+
Raises
81
+
------
82
+
MeiliSearchApiError
83
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
81
84
"""
82
85
returnIndex(self.config, uid).fetch_info()
83
86
84
87
defindex(self, uid):
85
-
"""Create a local reference to an index identified by `uid`, without doing an HTTP call.
86
-
Calling this method doesn't create an index by itself, but grants access to all the other methods in the Index class.
88
+
"""Create a local reference to an index identified by UID, without doing an HTTP call.
89
+
Calling this method doesn't create an index in the MeiliSearch instance, but grants access to all the other methods in the Index class.
87
90
88
91
Parameters
89
92
----------
@@ -100,23 +103,24 @@ def index(self, uid):
100
103
raiseException('The index UID should not be None')
101
104
102
105
defget_or_create_index(self, uid, options=None):
103
-
"""Retrieve an index in MeiliSearch, or create it if it doesn't exist yet.
106
+
"""Get an index, or create it if it doesn't exist.
104
107
105
108
Parameters
106
109
----------
107
110
uid: str
108
111
UID of the index
109
-
options: dict, optional
112
+
options (optional): dict
110
113
Options passed during index creation (ex: primaryKey)
111
114
112
115
Returns
113
116
-------
114
117
index : Index
115
-
An Index instance containing the information of the retrieved or newly created index.
118
+
An instance of Index containing the information of the retrieved or newly created index.
119
+
116
120
Raises
117
121
------
118
122
MeiliSearchApiError
119
-
In case of any other error found here https://docs.meilisearch.com/references/#errors-status-code
123
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
120
124
"""
121
125
try:
122
126
index_instance=self.get_index(uid)
@@ -131,82 +135,113 @@ def get_all_stats(self):
131
135
132
136
Get information about database size and all indexes
Dictionnary containing stats about your MeiliSearch instance
142
+
Dictionary containing stats about your MeiliSearch instance.
143
+
144
+
Raises
145
+
------
146
+
MeiliSearchApiError
147
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
138
148
"""
139
149
returnself.http.get(self.config.paths.stat)
140
150
141
151
defhealth(self):
142
-
"""Get health of MeiliSearch
152
+
"""Get health of the MeiliSearch server.
143
153
144
154
`204` HTTP status response when MeiliSearch is healthy.
145
155
146
156
Raises
147
-
----------
148
-
HTTPError
149
-
If MeiliSearch is not healthy
157
+
------
158
+
MeiliSearchApiError
159
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
150
160
"""
151
161
returnself.http.get(self.config.paths.health)
152
162
153
163
defget_keys(self):
154
-
"""Get all keys created
164
+
"""Get all keys.
155
165
156
-
Get list of all the keys that were created and all their related information.
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
163
178
"""
164
179
returnself.http.get(self.config.paths.keys)
165
180
166
181
defget_version(self):
167
182
"""Get version MeiliSearch
168
183
169
184
Returns
170
-
----------
185
+
-------
171
186
version: dict
172
187
Information about the version of MeiliSearch.
188
+
189
+
Raises
190
+
------
191
+
MeiliSearchApiError
192
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
173
193
"""
174
194
returnself.http.get(self.config.paths.version)
175
195
176
196
defversion(self):
177
197
"""Alias for get_version
178
198
179
199
Returns
180
-
----------
200
+
-------
181
201
version: dict
182
202
Information about the version of MeiliSearch.
203
+
204
+
Raises
205
+
------
206
+
MeiliSearchApiError
207
+
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
194
224
"""
195
225
returnself.http.post(self.config.paths.dumps)
196
226
197
227
defget_dump_status(self, uid):
198
-
"""Retrieves the status of a MeiliSearch dump creation
228
+
"""Retrieve the status of a MeiliSearch dump creation.
An error containing details about why MeiliSearch can't process your request. MeiliSearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
0 commit comments