File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -174,17 +174,18 @@ sub _build_index_config {
174174 my $doc = $docs -> {$name };
175175 my $index = $doc -> {index }
176176 or die " no index defined for $name documents" ;
177- my $type = $doc -> {type }
178- or die " no type defined for $name documents" ;
179177 die " $index specified for multiple documents"
180178 if $indices -> {$index };
181179 my $mapping = es_config-> mapping( $name , $api_version );
182180 my $settings = es_config-> index_settings( $name , $api_version );
181+ if ( $api_version le ' 6_0' ) {
182+ my $type = $doc -> {type }
183+ or die " no type defined for $name documents" ;
184+ $mapping = { $type => $mapping };
185+ }
183186 $indices -> {$index } = {
184187 settings => $settings ,
185- mappings => {
186- $type => $mapping ,
187- },
188+ mappings => $mapping ,
188189 };
189190 }
190191
You can’t perform that action at this time.
0 commit comments