Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Don't overwrite TypeName if it has been set to null
Browse files Browse the repository at this point in the history
In order to be able to use templates and at the same time remove
the doc type we shouldn't override it if it's set to null.
  • Loading branch information
orjan committed Sep 14, 2020
1 parent 830071b commit 4131406
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private ElasticsearchSinkState(ElasticsearchSinkOptions options)
if (string.IsNullOrWhiteSpace(options.IndexFormat)) throw new ArgumentException("options.IndexFormat");
if (string.IsNullOrWhiteSpace(options.TemplateName)) throw new ArgumentException("options.TemplateName");

// Strip type argument if ESv7 since multiple types are not supported anymore
if (options.AutoRegisterTemplateVersion == AutoRegisterTemplateVersion.ESv7)
// Since TypeName is deprecated we shouldn't set it, if has been deliberately set to null.
if (options.TypeName == null && options.AutoRegisterTemplateVersion == AutoRegisterTemplateVersion.ESv7)
{
options.TypeName = "_doc";
}
Expand Down

0 comments on commit 4131406

Please sign in to comment.