@@ -73,7 +73,6 @@ protected function createTargetIndex()
7373 $ payload = (new RawPayload ())
7474 ->set ('index ' , $ targetIndex )
7575 ->setIfNotEmpty ('body.settings ' , $ sourceIndexConfigurator ->getSettings ())
76- ->setIfNotEmpty ('body.mappings._default_ ' , $ sourceIndexConfigurator ->getDefaultMapping ())
7776 ->get ();
7877
7978 ElasticClient::indices ()
@@ -116,16 +115,6 @@ protected function updateTargetIndex()
116115 $ indices ->putSettings ($ targetIndexSettingsPayload );
117116 }
118117
119- if ($ defaultMapping = $ sourceIndexConfigurator ->getDefaultMapping ()) {
120- $ targetIndexMappingPayload = (new RawPayload ())
121- ->set ('index ' , $ targetIndex )
122- ->set ('type ' , '_default_ ' )
123- ->set ('body._default_ ' , $ defaultMapping )
124- ->get ();
125-
126- $ indices ->putMapping ($ targetIndexMappingPayload );
127- }
128-
129118 $ indices ->open ($ targetIndexPayload );
130119 } catch (Exception $ exception ) {
131120 $ indices ->open ($ targetIndexPayload );
@@ -169,7 +158,8 @@ protected function updateTargetIndexMapping()
169158 $ payload = (new RawPayload ())
170159 ->set ('index ' , $ targetIndex )
171160 ->set ('type ' , $ targetType )
172- ->set ('body. ' .$ targetType , $ mapping )
161+ ->set ('include_type_name ' , 'true ' )
162+ ->set ('body. ' . $ targetType , $ mapping )
173163 ->get ();
174164
175165 ElasticClient::indices ()
@@ -339,7 +329,7 @@ public function handle()
339329 $ sourceModel = $ this ->getModel ();
340330 $ sourceIndexConfigurator = $ sourceModel ->getIndexConfigurator ();
341331
342- if (! in_array (Migratable::class, class_uses_recursive ($ sourceIndexConfigurator ))) {
332+ if (!in_array (Migratable::class, class_uses_recursive ($ sourceIndexConfigurator ))) {
343333 $ this ->error (sprintf (
344334 'The %s index configurator must use the %s trait. ' ,
345335 get_class ($ sourceIndexConfigurator ),
0 commit comments