Skip to content

Commit

Permalink
rc corrected to response (opensearch-project#772)
Browse files Browse the repository at this point in the history
* 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 <35761519+oconpa@users.noreply.github.com>

* Corrected line 33

Signed-off-by: Patrick O'Connor <35761519+oconpa@users.noreply.github.com>

---------

Signed-off-by: Patrick O'Connor <35761519+oconpa@users.noreply.github.com>
  • Loading branch information
oconpa authored and dblock committed Aug 15, 2024
1 parent 67cdb85 commit 035225c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/bulk.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ response = client.bulk(docs)
if response["errors"]:
print(f"There were errors!")
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.
Expand All @@ -51,7 +51,7 @@ if response["errors"]:
for item in response["items"]:
print(f"{item['index']['status']}: {item['index']['error']['type']}")
else:
print(f"Bulk-inserted {len(rc['items'])} items.")
print(f"Bulk-inserted {len(response['items'])} items.")
```

## Bulk Helper
Expand Down Expand Up @@ -126,4 +126,4 @@ if len(failed) > 0:

if len(succeeded) > 0:
print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).")
```
```

0 comments on commit 035225c

Please sign in to comment.