Skip to content

Commit

Permalink
Replaced if_seq_num to if_seq_no and added test
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Darryl Aguilar <aguilarkyledarryl@gmail.com>
  • Loading branch information
noname4life committed Oct 5, 2022
1 parent dba374d commit d86a113
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion opensearchutil/bulk_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type bulkActionMetadata struct {
Routing *string `json:"routing,omitempty"`
Version *int64 `json:"version,omitempty"`
VersionType *string `json:"version_type,omitempty"`
IfSeqNum *int64 `json:"if_seq_num,omitempty"`
IfSeqNum *int64 `json:"if_seq_no,omitempty"`
IfPrimaryTerm *int64 `json:"if_primary_term,omitempty"`
WaitForActiveShards interface{} `json:"wait_for_active_shards,omitempty"`
Refresh *string `json:"refresh,omitempty"`
Expand Down
13 changes: 12 additions & 1 deletion opensearchutil/bulk_indexer_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,18 @@ func TestBulkIndexer(t *testing.T) {
`{"index":{"_index":"test","_id":"42"}}` + "\n",
},
{
"with version and no document",
"with if_seq_no and if_primary_term",
args{BulkIndexerItem{
Action: "index",
DocumentID: "42",
Index: "test",
IfSeqNum: int64Pointer(5),
IfPrimaryTerm: int64Pointer(1),
}},
`{"index":{"_index":"test","_id":"42","if_seq_no":5,"if_primary_term":1}}` + "\n",
},
{
"with version and no document, if_seq_no, and if_primary_term",
args{BulkIndexerItem{
Action: "index",
Index: "test",
Expand Down

0 comments on commit d86a113

Please sign in to comment.