diff --git a/elasticsearch/document/document.go b/elasticsearch/document/document.go index 088f737..c1f9d64 100644 --- a/elasticsearch/document/document.go +++ b/elasticsearch/document/document.go @@ -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, @@ -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, + } +}