Skip to content

Commit

Permalink
feat: add indexname to actions (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
burakbaga authored Jul 18, 2024
1 parent 9feedfd commit 3d6f7ed
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions elasticsearch/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ func NewDeleteAction(key []byte, routing *string) ESActionDocument {
}
}

func NewDeleteActionWithIndexName(indexName string, key []byte, routing *string) ESActionDocument {
return ESActionDocument{
ID: key,
Routing: routing,
Type: Delete,
IndexName: indexName,
}
}

func NewIndexAction(key []byte, source []byte, routing *string) ESActionDocument {
return ESActionDocument{
ID: key,
Expand All @@ -31,3 +40,13 @@ func NewIndexAction(key []byte, source []byte, routing *string) ESActionDocument
Type: Index,
}
}

func NewIndexActionWithIndexName(indexName string, key []byte, source []byte, routing *string) ESActionDocument {
return ESActionDocument{
ID: key,
Routing: routing,
Source: source,
Type: Index,
IndexName: indexName,
}
}

0 comments on commit 3d6f7ed

Please sign in to comment.