Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Dependencies

### Changed
Allow null values in arrays ([#687](https://github.com/opensearch-project/opensearch-java/pull/687))
- Allow null values in arrays ([#687](https://github.com/opensearch-project/opensearch-java/pull/687))
- Add an example for bulk update operation in samples ([#690](https://github.com/opensearch-project/opensearch-java/pull/690))

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,18 @@ public static void main(String[] args) {
.source(sc -> sc.fetch(false))
.ignoreThrottled(false)
.query(query);

SearchResponse<IndexData> searchResponse = client.search(searchReq.build(), IndexData.class);
LOGGER.info("Found {} documents", searchResponse.hits().hits().size());

LOGGER.info("Bulk update document");
doc1.setText("Updated Document");
BulkRequest request = new BulkRequest.Builder().operations(o -> o.update(u -> u.index(indexName).id("id1").document(doc1)))
.refresh(Refresh.WaitFor)
.build();
bulkResponse = client.bulk(request);
LOGGER.info("Bulk update response items: {}", bulkResponse.items().size());

LOGGER.info("Deleting index {}", indexName);
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest.Builder().index(indexName).build();
client.indices().delete(deleteIndexRequest);
Expand Down