Skip to content

Commit

Permalink
Allow fields in BulkOperation to be optional (opensearch-project#378)
Browse files Browse the repository at this point in the history
* Allow fields in BulkOperation to be optional

    https://opensearch.org/docs/1.3/api-reference/document-apis/bulk/#request-body
    > All actions support the same metadata: _index, _id, and _require_alias. If you don’t provide an ID, OpenSearch generates one automatically, which can make it challenging to update the document at a later time.

Signed-off-by: Cameron Durham <[email protected]>
  • Loading branch information
camerondurham authored Feb 8, 2023
1 parent f717617 commit 425a7ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Dependencies
### Changed
- Remove test artifacts from gh_pages workflow ([#335](https://github.com/opensearch-project/opensearch-js/issues/335))
- Make fields in `BulkOperation` optional to match OpenSearch Bulk API requirements ([#378](https://github.com/opensearch-project/opensearch-js/pull/378))

### Deprecated
### Removed
### Fixed
Expand All @@ -57,4 +59,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291))

[2.1]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.1.0
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.1...HEAD
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.1...HEAD
12 changes: 6 additions & 6 deletions api/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export interface BulkIndexOperation extends BulkOperation { }
export interface BulkIndexResponseItem extends BulkResponseItemBase { }

export interface BulkOperation {
_id: Id;
_index: IndexName;
retry_on_conflict: integer;
routing: Routing;
version: VersionNumber;
version_type: VersionType;
_id?: Id;
_index?: IndexName;
retry_on_conflict?: integer;
routing?: Routing;
version?: VersionNumber;
version_type?: VersionType;
}

export interface BulkOperationContainer {
Expand Down

0 comments on commit 425a7ba

Please sign in to comment.