rc corrected to response (#772)
* rc corrected to response There seems to be a mistype in the code. I believe it's meant to say response Signed-off-by: Patrick O'Connor <[email protected]> * Corrected line 33 Signed-off-by: Patrick O'Connor <[email protected]> --------- Signed-off-by: Patrick O'Connor <[email protected]>
This commit is contained in:
+3
-3
@@ -30,7 +30,7 @@ response = client.bulk(docs)
|
|||||||
if response["errors"]:
|
if response["errors"]:
|
||||||
print(f"There were errors!")
|
print(f"There were errors!")
|
||||||
else:
|
else:
|
||||||
print(f"Bulk-inserted {len(rc['items'])} items.")
|
print(f"Bulk-inserted {len(response['items'])} items.")
|
||||||
```
|
```
|
||||||
|
|
||||||
The client can also serialize an array of data into bulk-delimited JSON for you. See [samples/bulk/bulk_array.py](../samples/bulk/bulk_array.py) for a working sample.
|
The client can also serialize an array of data into bulk-delimited JSON for you. See [samples/bulk/bulk_array.py](../samples/bulk/bulk_array.py) for a working sample.
|
||||||
@@ -51,7 +51,7 @@ if response["errors"]:
|
|||||||
for item in response["items"]:
|
for item in response["items"]:
|
||||||
print(f"{item['index']['status']}: {item['index']['error']['type']}")
|
print(f"{item['index']['status']}: {item['index']['error']['type']}")
|
||||||
else:
|
else:
|
||||||
print(f"Bulk-inserted {len(rc['items'])} items.")
|
print(f"Bulk-inserted {len(response['items'])} items.")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Bulk Helper
|
## Bulk Helper
|
||||||
@@ -126,4 +126,4 @@ if len(failed) > 0:
|
|||||||
|
|
||||||
if len(succeeded) > 0:
|
if len(succeeded) > 0:
|
||||||
print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).")
|
print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).")
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user