Skip to content

Commit 9e34426

Browse files
bors[bot]meili-botalallema
authored
Merge #370
370: Changes related to the next MeiliSearch release (v0.25.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#157 This PR: - gathers the changes related to the next MeiliSearch release (v0.25.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases). - might eventually contain test failures until the MeiliSearch v0.25.0 is out. ⚠️ This PR should NOT be merged until the next release of MeiliSearch (v0.25.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ Done: - #371 - #381 - #372 - #382 - #396 Co-authored-by: meili-bot <[email protected]> Co-authored-by: alallema <[email protected]> Co-authored-by: Amélie <[email protected]>
2 parents a92906c + 1c69904 commit 9e34426

25 files changed

+858
-478
lines changed

.code-samples.meilisearch.yaml

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ create_an_index_1: |-
1212
update_an_index_1: |-
1313
client.index('movies').update(primary_key='movie_review_id')
1414
delete_an_index_1: |-
15+
client.delete_index('movies')
16+
// OR
1517
client.index('movies').delete()
1618
get_one_document_1: |-
1719
client.index('movies').get_document(25684)
@@ -39,12 +41,35 @@ delete_documents_1: |-
3941
client.index('movies').delete_documents([23488, 153738, 437035, 363869])
4042
search_post_1: |-
4143
client.index('movies').search('American ninja')
42-
get_update_1: |-
43-
client.index('movies').get_update_status(1)
44-
get_all_updates_1: |-
45-
client.index('movies').get_all_update_status()
46-
get_keys_1: |-
44+
get_task_by_index_1: |-
45+
client.index('movies').get_task(1)
46+
get_all_tasks_1: |-
47+
client.get_tasks()
48+
get_task_1: |-
49+
client.get_task(1)
50+
get_all_tasks_by_index_1: |-
51+
client.index('movies').get_tasks()
52+
get_one_key_1: |-
53+
client.get_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
54+
get_all_keys_1: |-
4755
client.get_keys()
56+
create_a_key_1: |-
57+
client.create_key(options={
58+
'description': 'Add documents: Products API key',
59+
'actions': ['documents.add'],
60+
'indexes': ['products'],
61+
'expiresAt': '2042-04-02T00:42:42Z'
62+
})
63+
update_a_key_1: |-
64+
client.update_key(key='d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4',
65+
options={
66+
'description': 'Manage documents: Products/Reviews API key',
67+
'actions': ['documents.add', 'documents.delete'],
68+
'indexes': ['products', 'reviews'],
69+
'expiresAt': '2042-04-02T00:42:42Z'
70+
})
71+
delete_a_key_1: |-
72+
client.delete_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
4873
get_settings_1: |-
4974
client.index('movies').get_settings()
5075
update_settings_1: |-
@@ -423,3 +448,28 @@ geosearch_guide_sort_usage_2: |-
423448
client.index('restaurants').search('', {
424449
'sort': ['_geoPoint(48.8583701,2.2922926):asc', 'rating:desc']
425450
})
451+
security_guide_search_key_1: |-
452+
client = Client('http://127.0.0.1:7700', 'apiKey')
453+
client.index('patient_medical_records').search()
454+
security_guide_update_key_1: |-
455+
client = Client('http://127.0.0.1:7700', 'masterKey')
456+
client.update_key(key='d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4', options={
457+
'indexes': ['doctors']
458+
})
459+
security_guide_create_key_1: |-
460+
client = Client('http://127.0.0.1:7700', 'masterKey')
461+
client.create_key(options={
462+
'description': 'Search patient records key',
463+
'actions': ['search'],
464+
'indexes': ['patient_medical_records'],
465+
'expiresAt': '2023-01-01T00:00:00Z'
466+
})
467+
security_guide_list_keys_1: |-
468+
client = Client('http://127.0.0.1:7700', 'masterKey')
469+
client.get_keys()
470+
security_guide_delete_key_1: |-
471+
client = Client('http://127.0.0.1:7700', 'masterKey')
472+
client.delete_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
473+
authorization_header_1: |-
474+
client = Client('http://127.0.0.1:7700', 'masterKey')
475+
client.get_keys()

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ documents = [
8787
]
8888

8989
# If the index 'movies' does not exist, MeiliSearch creates it when you first add the documents.
90-
index.add_documents(documents) # => { "updateId": 0 }
90+
index.add_documents(documents) # => { "uid": 0 }
9191
```
9292

93-
With the `updateId`, you can check the status (`enqueued`, `processing`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
93+
With the task `uid`, you can check the status (`enqueued`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://docs.meilisearch.com/reference/api/tasks.html#get-task).
9494

9595
#### Basic Search <!-- omit in toc -->
9696

@@ -165,7 +165,7 @@ index.update_filterable_attributes([
165165

166166
You only need to perform this operation once.
167167

168-
Note that MeiliSearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [update status](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
168+
Note that MeiliSearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [task](https://docs.meilisearch.com/reference/api/tasks.html#get-task).
169169

170170
Then, you can perform the search:
171171

@@ -197,7 +197,7 @@ index.search(
197197

198198
## 🤖 Compatibility with MeiliSearch
199199

200-
This package only guarantees the compatibility with the [version v0.24.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.24.0).
200+
This package only guarantees the compatibility with the [version v0.25.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.25.0).
201201

202202
## 💡 Learn More
203203

meilisearch/_httprequests.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HttpRequests:
1212
def __init__(self, config: Config) -> None:
1313
self.config = config
1414
self.headers = {
15-
'X-Meili-Api-Key': self.config.api_key,
15+
'Authorization': f'Bearer {self.config.api_key}',
1616
}
1717

1818
def send_request(
@@ -60,6 +60,14 @@ def post(
6060
) -> Any:
6161
return self.send_request(requests.post, path, body, content_type)
6262

63+
def patch(
64+
self,
65+
path: str,
66+
body: Optional[Union[Dict[str, Any], List[Dict[str, Any]], List[str], str]] = None,
67+
content_type: Optional[str] = 'application/json',
68+
) -> Any:
69+
return self.send_request(requests.patch, path, body, content_type)
70+
6371
def put(
6472
self,
6573
path: str,

0 commit comments

Comments
 (0)