Skip to content

Commit 63293c0

Browse files
committed
Update code-samples for Meilisearch v1.2
1 parent e1186c2 commit 63293c0

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.code-samples.meilisearch.yaml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33
# the documentation on build
44
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
55
---
6-
get_documents_post_1: |-
7-
POST http://localhost:7700/indexes/books/documents/fetch
8-
with data: {
9-
"filter": "(rating > 3 AND (genres = Adventure OR genres = Fiction)) AND language = English",
10-
"fields": ["title", "genres", "rating", "language"],
11-
"limit": 3
12-
}
13-
14-
delete_documents_by_filter_1: |-
15-
POST http://localhost:7700/indexes/movies/documents/delete
16-
with data: { "filter": "genres = action OR genres = adventure" }
17-
18-
get_documents_1: |-
19-
GET 'http://localhost:7700/indexes/movies/documents?limit=2&filter=genres=action
20-
mind the filter in the query param (use the POST route in the integrations)
21-
226
synonyms_guide_1: |-
237
client.index('movies').updateSynonyms({
248
"great": ["fantastic"],
@@ -59,7 +43,16 @@ get_one_document_1: |-
5943
.index('movies')
6044
.getDocument(25684, { fields: ['id', 'title', 'poster', 'release_date'] })
6145
get_documents_1: |-
62-
client.index('movies').getDocuments({ limit: 2 })
46+
client.index('movies').getDocuments({
47+
limit: 2,
48+
filter: 'genres = action'
49+
})
50+
get_documents_post_1: |-
51+
client.index('books').getDocuments({
52+
filter: '(rating > 3 AND (genres = Adventure OR genres = Fiction)) AND language = English',
53+
fields: ['title', 'genres', 'rating', 'language'],
54+
limit: 3
55+
})
6356
add_or_replace_documents_1: |-
6457
client.index('movies').addDocuments([{
6558
id: 287947,
@@ -80,6 +73,10 @@ delete_one_document_1: |-
8073
client.index('movies').deleteDocument(25684)
8174
delete_documents_by_batch_1: |-
8275
client.index('movies').deleteDocuments([23488, 153738, 437035, 363869])
76+
delete_documents_by_filter_1: |-
77+
client.index('movies').deleteDocuments({
78+
filter: 'genres = action OR genres = adventure'
79+
})
8380
search_post_1: |-
8481
client.index('movies').search('American ninja')
8582
search_get_1: |-

0 commit comments

Comments
 (0)