Skip to content

Commit

Permalink
Adding new code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
alallema committed May 31, 2023
1 parent f015fa8 commit 7a814c1
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
get_documents_post_1: |-
POST http://localhost:7700/indexes/books/documents/fetch
with data: {
"filter": "(rating > 3 AND (genres = Adventure OR genres = Fiction)) AND language = English",
"fields": ["title", "genres", "rating", "language"],
"limit": 3
}
delete_documents_by_filter_1: |-
POST http://localhost:7700/indexes/movies/documents/delete
with data: { "filter": "genres = action OR genres = adventure" }
get_documents_1: |-
GET 'http://localhost:7700/indexes/movies/documents?limit=2&filter=genres=action
mind the filter in the query param (use the POST route in the integrations)
get_one_index_1: |-
client.get_index('movies')
list_all_indexes_1: |-
Expand All @@ -38,7 +22,19 @@ get_one_document_1: |-
'fields': ['id', 'title', 'poster', 'release_date']
})
get_documents_1: |-
client.index('movies').get_documents({'limit':2})
client.index('movies').get_documents({'limit':2, 'filter': 'genres=action'})
get_documents_post_1: |-
client.index('books').get_documents({
'limit':3,
'fields': ['title', 'genres', 'rating', 'language'],
'filter': [['rating > 3'], ['genres=Adventure', 'genres=Fiction'], ['language=English']]
})
# OR
client.index('books').get_documents({
'limit':3,
'fields': ['title', 'genres', 'rating', 'language'],
'filter': '(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English'
})
add_or_replace_documents_1: |-
client.index('movies').add_documents([{
'id': 287947,
Expand All @@ -59,6 +55,8 @@ delete_one_document_1: |-
client.index('movies').delete_document(25684)
delete_documents_by_batch_1: |-
client.index('movies').delete_documents([23488, 153738, 437035, 363869])
delete_documents_by_filter_1: |-
client.index('movies').delete_documents({filter=[['genres=action', 'genres=adventure']]})
search_post_1: |-
client.index('movies').search('American ninja')
multi_search_1: |-
Expand Down

0 comments on commit 7a814c1

Please sign in to comment.