Skip to content

Commit

Permalink
Update code-sample for v0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
alallema committed Jul 6, 2022
1 parent cff2433 commit b5cc8f6
Showing 1 changed file with 105 additions and 69 deletions.
174 changes: 105 additions & 69 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
get_all_tasks_filtering_1: |-
get_all_tasks_filtering_2: |-
get_all_tasks_paginating_1: |-
get_all_tasks_paginating_2: |-
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: |-
client.get_index('movies')
PLEASE_UPDATE_ME>>>>>>>>>>>>>list_all_indexes_1: |-
client.get_indexes()
list_all_indexes_1: |-
client.get_indexes({'limit':3})
create_an_index_1: |-
client.create_index('movies', {'primaryKey': 'id'})
update_an_index_1: |-
Expand All @@ -28,8 +15,10 @@ delete_an_index_1: |-
client.delete_index('movies')
// OR
client.index('movies').delete()
PLEASE_UPDATE_ME>>>>>>>>>>>>>get_one_document_1: |-
client.index('movies').get_document(25684)
get_one_document_1: |-
client.index('movies').get_document(25684, {
'fields': ['id','title', 'poster', 'release_date']
})
get_documents_1: |-
client.index('movies').get_documents({'limit':2})
add_or_replace_documents_1: |-
Expand All @@ -54,80 +43,80 @@ delete_documents_1: |-
client.index('movies').delete_documents([23488, 153738, 437035, 363869])
search_post_1: |-
client.index('movies').search('American ninja')
PLEASE_REMOVE_ME>>>>>>>>>>>>>get_task_by_index_1: |-
client.index('movies').get_task(1)
get_all_tasks_1: |-
client.get_tasks()
get_task_1: |-
client.get_task(1)
PLEASE_REMOVE_ME>>>>>>>>>>>>>get_all_tasks_by_index_1: |-
client.index('movies').get_tasks()
get_one_key_1: |-
client.get_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
PLEASE_UPDATE_ME>>>>>>>>>>>>>get_all_keys_1: |-
client.get_keys()
get_all_keys_1: |-
client.get_keys({'limit': 3})
create_a_key_1: |-
client.create_key(options={
'description': 'Add documents: Products API key',
'actions': ['documents.add'],
'indexes': ['products'],
'expiresAt': '2042-04-02T00:42:42Z'
})
PLEASE_UPDATE_ME>>>>>>>>>>>>>update_a_key_1: |-
client.update_key(key='d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4',
update_a_key_1: |-
client.update_key(key_or_uid='d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4',
options={
'description': 'Manage documents: Products/Reviews API key',
'actions': ['documents.add', 'documents.delete'],
'indexes': ['products', 'reviews'],
'expiresAt': '2042-04-02T00:42:42Z'
'name': 'Products/Reviews API key',
'description': 'Manage documents: Products/Reviews API key'
})
PLEASE_UPDATE_ME>>>>>>>>>>>>>delete_a_key_1: |-
client.delete_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
delete_a_key_1: |-
client.delete_key('6062abda-a5aa-4414-ac91-ecd7944c0f8d')
get_settings_1: |-
client.index('movies').get_settings()
PLEASE_UPDATE_ME>>>>>>>>>>>>>update_settings_1: |-
update_settings_1: |-
client.index('movies').update_settings({
'rankingRules': [
'words',
'typo',
'proximity',
'attribute',
'sort',
'exactness',
'release_date:desc',
'rank:desc'
'words',
'typo',
'proximity',
'attribute',
'sort',
'exactness',
'release_date:desc',
'rank:desc'
],
'distinctAttribute': 'movie_id',
'searchableAttributes': [
'title',
'overview',
'genres'
'title',
'overview',
'genres'
],
'displayedAttributes': [
'title',
'overview',
'genres',
'release_date'
'title',
'overview',
'genres',
'release_date'
],
'sortableAttributes': [
'title',
'release_date'
'title',
'release_date'
],
'stopWords': [
'the',
'a',
'an'
'the',
'a',
'an'
],
'synonyms': {
'wolverine': ['xmen', 'logan'],
'logan': ['wolverine']
'wolverine': ['xmen', 'logan'],
'logan': ['wolverine']
},
'typoTolerance': {
'minWordSizeForTypos': {
'oneTypo': 8,
'twoTypos': 10
},
'disableOnAttributes': ['title']
'minWordSizeForTypos': {
'oneTypo': 8,
'twoTypos': 10
},
'disableOnAttributes': ['title']
},
'pagination': {
'maxTotalHits': 5000
},
'faceting': {
'maxValuesPerFacet': 200
}
})
reset_settings_1: |-
Expand Down Expand Up @@ -293,7 +282,7 @@ search_parameter_guide_highlight_tag_1: |-
'highlightPreTag': '<span class="highlight">',
'highlightPostTag': '</span>'
})
PLEASE_UPDATE_ME>>>>>>>>>>>>>search_parameter_guide_matches_1: |-
search_parameter_guide_show_matches_position_1: |-
client.index('movies').search('winter feast', {
'showMatchesPosition': 'true'
})
Expand Down Expand Up @@ -403,8 +392,8 @@ documents_guide_add_movie_1: |-
'movie_id': '123sq178',
'title': 'Amélie Poulain'
}])
PLEASE_UPDATE_ME>>>>>>>>>>>>>PLEASE_UPDATE_ME>>>>>>>>>>>>>getting_started_check_task_status: |-
client.index('movies').get_task(0)
getting_started_check_task_status: |-
client.get_task(0)
getting_started_add_documents_md: |-
```bash
pip3 install meilisearch
Expand Down Expand Up @@ -493,7 +482,7 @@ getting_started_configure_settings: |-
getting_started_communicating_with_a_protected_instance: |-
client = Client('http://127.0.0.1:7700', 'apiKey')
client.index('movies').search()
faceted_search_PLEASE_UPDATE_ME>>>>>>>>>>>>>update_settings_1: |-
faceted_search_update_settings_1: |-
client.index('movies').update_filterable_attributes([
'director',
'genres',
Expand All @@ -502,7 +491,7 @@ faceted_search_filter_1: |-
client.index('movies').search('thriller', {
'filter': [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
PLEASE_UPDATE_ME>>>>>>>>>>>>>faceted_search_facets_distribution_1: |-
faceted_search_facets_distribution_1: |-
client.index('movies').search('Batman', {
'facets': ['genres']
})
Expand Down Expand Up @@ -579,10 +568,10 @@ primary_field_guide_add_document_primary_key: |-
security_guide_search_key_1: |-
client = Client('http://127.0.0.1:7700', 'apiKey')
client.index('patient_medical_records').search()
PLEASE_UPDATE_ME>>>>>>>>>>>>>security_guide_update_key_1: |-
security_guide_update_key_1: |-
client = Client('http://127.0.0.1:7700', 'masterKey')
client.update_key(key='d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4', options={
'indexes': ['doctors']
client.update_key(key_or_uid='74c9c733-3368-4738-bbe5-1d18a5fecb37', options={
'description': 'Default Search API Key'
})
security_guide_create_key_1: |-
client = Client('http://127.0.0.1:7700', 'masterKey')
Expand All @@ -595,9 +584,9 @@ security_guide_create_key_1: |-
security_guide_list_keys_1: |-
client = Client('http://127.0.0.1:7700', 'masterKey')
client.get_keys()
PLEASE_UPDATE_ME>>>>>>>>>>>>>security_guide_delete_key_1: |-
security_guide_delete_key_1: |-
client = Client('http://127.0.0.1:7700', 'masterKey')
client.delete_key('d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4')
client.delete_key('ac5cd97d-5a4b-4226-a868-2d0eb6d197ab')
authorization_header_1: |-
client = Client('http://127.0.0.1:7700', 'masterKey')
client.get_keys()
Expand All @@ -614,3 +603,50 @@ tenant_token_guide_generate_sdk_1: |-
tenant_token_guide_search_sdk_1: |-
front_end_client = Client('http://127.0.0.1:7700', token)
front_end_client.index('patient_medical_records').search('blood test')
get_all_tasks_filtering_1: |-
client.index.('movies').get_tasks()
// OR
client.get_tasks({'indexUid': ['movies']})
get_all_tasks_filtering_2: |-
client.get_tasks({
'status': ['succeeded', 'failed'],
'type': ['documentAdditionOrUpdate']
})
get_all_tasks_paginating_1: |-
client.get_tasks({
'limit': 2,
'from': 10
})
get_all_tasks_paginating_2: |-
client.get_tasks({
'limit': 2,
'from': 8
})
get_pagination_settings_1: |-
update_pagination_settings_1: |-
client.index('books').update_settings({
'pagination': {
'maxTotalHits': 100
}
})
reset_pagination_settings_1: |-
get_faceting_settings_1: |-
update_faceting_settings_1: |-
client.index('books').update_settings({
'faceting': {
'maxValuesPerFacet': 2
}
})
reset_faceting_settings_1: |-
settings_guide_faceting_1: |-
client.index('movies').update_settings({
'faceting': {
'maxValuesPerFacet': 5
}
})
settings_guide_pagination_1: |-
client.index('movies').update_settings({
'pagination': {
'maxTotalHits': 50
}
})

0 comments on commit b5cc8f6

Please sign in to comment.