Make elasticsearch refresh opt configurable

This commit is contained in:
ionutboangiu
2024-11-27 18:41:17 +02:00
committed by Dan Christian Bogos
parent f1cdf920df
commit 8d7628410e
8 changed files with 42 additions and 12 deletions

View File

@@ -172,9 +172,11 @@ func (e *ElasticEE) ExportEvent(event any, key string) error {
}
req := e.client.Index(indexName).
Id(key).
Request(event).
Refresh(refresh.True)
Request(event)
if opts.Refresh != nil {
req.Refresh(refresh.Refresh{Name: *opts.Refresh})
}
if opts.OpType != nil {
req.OpType(optype.OpType{Name: *opts.OpType})
}