Skip to content

Commit 0ef2010

Browse files
committed
[AUTOMATION POST DEPLOYMENT] Update code samples
1 parent eac73d4 commit 0ef2010

5 files changed

Lines changed: 18 additions & 20 deletions

snippets/generated-code-samples/code_samples_add_or_replace_documents_1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ client.index('movies').addDocuments([{
2222
poster: 'https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg',
2323
overview: 'A boy is given the ability to become an adult superhero in times of need with a single magic word.',
2424
release_date: '2019-03-23'
25-
}])
25+
}], { skipCreation: true })
2626
```
2727

2828
```python Python

snippets/generated-code-samples/code_samples_add_or_update_documents_1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ client.index('movies').updateDocuments([{
1818
id: 287947,
1919
title: 'Shazam ⚡️',
2020
genres: 'comedy'
21-
}])
21+
}], { skipCreation: true })
2222
```
2323

2424
```python Python

snippets/generated-code-samples/code_samples_get_network_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ curl \
55
-X GET 'MEILISEARCH_URL/network'
66
```
77

8+
```javascript JS
9+
client.getNetwork()
10+
```
11+
812
```python Python
913
client.get_all_networks()
1014
```

snippets/generated-code-samples/code_samples_rename_an_index_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ curl \
77
--data-binary '{ "uid": "INDEX_B" }'
88
```
99

10+
```javascript JS
11+
client.updateIndex('movies', { uid: 'films' })
12+
```
13+
1014
```python Python
1115
client.index("INDEX_A").update(new_uid="INDEX_B")
1216
```

snippets/generated-code-samples/code_samples_update_network_1.mdx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,15 @@ curl \
2121

2222
```javascript JS
2323
client.initializeNetwork({
24-
self: 'leader-1',
24+
self: 'https://instance1.meilisearch.com',
2525
remotes: {
26-
'leader-1': {
27-
url: 'http://127.0.0.1:7700',
28-
searchApiKey: 'searchKey',
29-
writeApiKey: 'masterKey',
30-
},
31-
'remote-paris': {
32-
url: 'http://192.168.1.11:7700',
33-
searchApiKey: 'searchKeyRemote',
34-
writeApiKey: 'masterKey',
35-
},
36-
},
37-
shards: {
38-
movies: {
39-
remotes: ['leader-1', 'remote-paris'],
40-
},
41-
},
42-
});
26+
instance2: {
27+
url: 'https://instance2.meilisearch.com',
28+
searchApiKey: 'SEARCH_API_KEY',
29+
writeApiKey: 'WRITE_API_KEY'
30+
}
31+
}
32+
})
4333
```
4434

4535
```python Python

0 commit comments

Comments
 (0)