Skip to content

Code samples changes related to Meilisearch release (v0.28.0) #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,34 @@
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
get_all_tasks_filtering_1: |-
await client.getTasks(TasksQuery(indexUid: ['movies']);
get_all_tasks_filtering_2: |-
await client.getTasks(TasksQuery(status: ['succeeded', 'failed'], type: ['documentAdditionOrUpdate']);
get_all_tasks_paginating_1: |-
await client.getTasks(TasksQuery(limit: 2, from: 10);
get_all_tasks_paginating_2: |-
await client.getTasks(TasksQuery(limit: 2, from: 8);
get_pagination_settings_1: |-
update_pagination_settings_1: |-
reset_pagination_settings_1: |-
get_faceting_settings_1: |-
update_faceting_settings_1: |-
reset_faceting_settings_1: |-
settings_guide_faceting_1: |-
settings_guide_pagination_1: |-
get_one_index_1: |-
await client.getIndex('movies');
list_all_indexes_1: |-
await client.getIndexes();
await client.getIndexes(TasksQuery(limit: 3));
create_an_index_1: |-
await client.createIndex('movies', primaryKey: 'id');
update_an_index_1: |-
await client.index('movies').update(primaryKey: 'id');
delete_an_index_1: |-
await client.index('movies').delete();
get_one_document_1: |-
await client.index('movies').getDocument(25684);
await client.index('movies').getDocument(25684, fields: ['id', 'title', 'poster', 'release_date']);
get_documents_1: |-
await client.index('movies').getDocuments(limit: 2);
add_or_replace_documents_1: |-
Expand Down Expand Up @@ -45,10 +61,6 @@ delete_documents_1: |-
await client.index('movies').deleteDocuments([23488, 153738, 437035, 363869]);
search_post_1: |-
await client.index('movies').search('American ninja');
get_task_by_index_1: |-
await client.index('movies').getTask(1);
get_all_tasks_by_index_1: |-
await client.index('movies').getTasks();
get_task_1: |-
await client.getTask(1);
get_all_tasks_1: |-
Expand Down Expand Up @@ -197,7 +209,7 @@ search_parameter_guide_highlight_1: |-
await client
.index('movies')
.search('winter feast', attributesToHighlight: ['overview']);
search_parameter_guide_matches_1: |-
search_parameter_guide_show_matches_position_1: |-
await client.index('movies').search('winter feast', showMatchesPosition: true);
settings_guide_synonyms_1: |-
await client.index('tops').updateSettings(IndexSettings(synonyms: {
Expand Down Expand Up @@ -301,7 +313,7 @@ getting_started_update_searchable_attributes: |-
getting_started_update_stop_words: |-
await client.index('movies').updateStopWords(['the']);
getting_started_check_task_status: |-
await client.index('movies').getTask(0);
await client.getTask(0);
getting_started_synonyms: |-
await client.index('movies').updateSynonyms({
winnie: ['piglet'],
Expand Down Expand Up @@ -344,7 +356,7 @@ faceted_search_filter_1: |-
['genres = Horror', 'genres = Mystery'],
'director = "Jordan Peele"'
]);
faceted_search_facets_distribution_1: |-
faceted_search_facets_1: |-
await client.index('movies').search('Batman', facets: ['genres']);
faceted_search_walkthrough_filter_1: |-
await client.index('movies').search('thriller', filter: [
Expand Down Expand Up @@ -403,7 +415,7 @@ authorization_header_1: |-
get_one_key_1: |-
await client.getKey('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4');
get_all_keys_1: |-
await client.getKeys();
await client.getKeys(KeysQuery(limit: 3));
create_a_key_1: |-
await client.createKey(
description: 'Add documents: Products API key',
Expand All @@ -415,18 +427,16 @@ update_a_key_1: |-
await client.updateKey(
'd0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4',
description: 'Manage documents: Products/Reviews API key',
actions: ['documents.add', 'documents.delete'],
indexes: ['products', 'reviews'],
expiresAt: DateTime(2042, 04, 02),
name: 'Products/Reviews API key'
);
delete_a_key_1: |-
await client.deleteKey('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4');
await client.deleteKey('6062abda-a5aa-4414-ac91-ecd7944c0f8d');
security_guide_search_key_1: |-
var client = MeiliSearchClient('http://127.0.0.1:7700', 'apiKey');
await client.index('patient_medical_records').search();
security_guide_update_key_1: |-
var client = MeiliSearchClient('http://127.0.0.1:7700', 'masterKey');
await client.updateKey('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4', indexes: ['doctors']);
await client.updateKey('74c9c733-3368-4738-bbe5-1d18a5fecb37', description: 'Default Search API Key');
security_guide_create_key_1: |-
var client = MeiliSearchClient('http://127.0.0.1:7700', 'masterKey');
await client.createKey(
Expand All @@ -440,7 +450,7 @@ security_guide_list_keys_1: |-
await client.getKeys();
security_guide_delete_key_1: |-
var client = MeiliSearchClient('http://127.0.0.1:7700', 'masterKey');
await client.deleteKey('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4');
await client.deleteKey('ac5cd97d-5a4b-4226-a868-2d0eb6d197ab');
tenant_token_guide_generate_sdk_1: |-
final uid = '85c3c2f9-bdd6-41f1-abd8-11fcf80e0f76';
final apiKey = 'B5KdX2MY2jV6EXfUs6scSfmC...';
Expand Down