Skip to content

Commit c69ffae

Browse files
committed
Put back code samples we should not have deleted
1 parent ae47751 commit c69ffae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.code-samples.meilisearch.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,19 @@ primary_field_guide_add_document_primary_key: |-
505505
authorization_header_1: |-
506506
client = Client('http://localhost:7700', 'masterKey')
507507
client.get_keys()
508+
tenant_token_guide_generate_sdk_1: |-
509+
uid = '85c3c2f9-bdd6-41f1-abd8-11fcf80e0f76';
510+
api_key = 'B5KdX2MY2jV6EXfUs6scSfmC...'
511+
expires_at = datetime(2025, 12, 20)
512+
search_rules = {
513+
'patient_medical_records': {
514+
'filter': 'user_id = 1'
515+
}
516+
}
517+
token = client.generate_tenant_token(api_key_uid=uid, search_rules=search_rules, api_key=api_key, expires_at=expires_at)
518+
tenant_token_guide_search_sdk_1: |-
519+
front_end_client = Client('http://localhost:7700', token)
520+
front_end_client.index('patient_medical_records').search('blood test')
508521
get_all_tasks_paginating_1: |-
509522
client.get_tasks({
510523
'limit': 2,

0 commit comments

Comments
 (0)