Skip to content

Commit

Permalink
Merge pull request #17 from Trendyol/bugfix/it-bulk-insert
Browse files Browse the repository at this point in the history
bugfix: Document ID Issue in `BulkInsert`
  • Loading branch information
GokselKUCUKSAHIN authored Oct 29, 2024
2 parents e5b2ba9 + 08b4c78 commit 5695ac1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/testing/elasticsearch_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (e *elasticsearchRepository) BulkInsert(documents []FooDocument) error {
var bulkRequestBody strings.Builder

for i := range documents {
meta := fmt.Sprintf(`{"index":{"_index":"%s","_id":"%s"}}%s`, constants.TestIndex, documents[i], "\n")
meta := fmt.Sprintf(`{"index":{"_index":"%s","_id":"%s"}}%s`, constants.TestIndex, documents[i].Id, "\n")
bulkRequestBody.WriteString(meta)

docJson, err := json.Marshal(documents[i])
Expand Down

0 comments on commit 5695ac1

Please sign in to comment.