Skip to content

Commit 3f5e01b

Browse files
Implement breaking changes for examples to work with opensearch-py v3 (#10753) (#10755)
1 parent 4b72482 commit 3f5e01b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_clients/python-low-level.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ index_body = {
188188
}
189189
}
190190

191-
response = client.indices.create(index_name, body=index_body)
191+
response = client.indices.create(index=index_name, body=index_body)
192192
```
193193
{% include copy.html %}
194194

@@ -219,7 +219,7 @@ You can perform several operations at the same time by using the `bulk()` method
219219
```python
220220
movies = '{ "index" : { "_index" : "my-dsl-index", "_id" : "2" } } \n { "title" : "Interstellar", "director" : "Christopher Nolan", "year" : "2014"} \n { "create" : { "_index" : "my-dsl-index", "_id" : "3" } } \n { "title" : "Star Trek Beyond", "director" : "Justin Lin", "year" : "2015"} \n { "update" : {"_id" : "3", "_index" : "my-dsl-index" } } \n { "doc" : {"year" : "2016"} }'
221221

222-
client.bulk(movies)
222+
client.bulk(body=movies)
223223
```
224224
{% include copy.html %}
225225

@@ -309,7 +309,7 @@ index_body = {
309309
}
310310
}
311311

312-
response = client.indices.create(index_name, body=index_body)
312+
response = client.indices.create(index=index_name, body=index_body)
313313
print('\nCreating index:')
314314
print(response)
315315

@@ -335,7 +335,7 @@ print(response)
335335

336336
movies = '{ "index" : { "_index" : "my-dsl-index", "_id" : "2" } } \n { "title" : "Interstellar", "director" : "Christopher Nolan", "year" : "2014"} \n { "create" : { "_index" : "my-dsl-index", "_id" : "3" } } \n { "title" : "Star Trek Beyond", "director" : "Justin Lin", "year" : "2015"} \n { "update" : {"_id" : "3", "_index" : "my-dsl-index" } } \n { "doc" : {"year" : "2016"} }'
337337

338-
client.bulk(movies)
338+
client.bulk(body=movies)
339339

340340
# Search for the document.
341341
q = 'miller'

0 commit comments

Comments
 (0)