18
18
19
19
use Exception ;
20
20
use Pimcore \Bundle \GenericDataIndexBundle \Message \UpdateClassMappingMessage ;
21
- use Pimcore \Bundle \GenericDataIndexBundle \SearchIndexAdapter \SearchIndexServiceInterface ;
22
21
use Pimcore \Bundle \GenericDataIndexBundle \Service \SearchIndex \IndexQueue \EnqueueServiceInterface ;
23
- use Pimcore \Bundle \GenericDataIndexBundle \Service \SearchIndex \IndexService \ElementTypeAdapter \DataObjectTypeAdapter ;
24
22
use Pimcore \Bundle \GenericDataIndexBundle \Service \SearchIndex \IndexService \IndexHandler \DataObjectIndexHandler ;
25
23
use Pimcore \Bundle \GenericDataIndexBundle \Service \SettingsStoreServiceInterface ;
26
24
use Pimcore \Bundle \GenericDataIndexBundle \Traits \LoggerAwareTrait ;
@@ -36,9 +34,7 @@ final class UpdateClassMappingHandler
36
34
37
35
public function __construct (
38
36
private readonly DataObjectIndexHandler $ dataObjectMappingHandler ,
39
- private readonly DataObjectTypeAdapter $ dataObjectTypeAdapter ,
40
37
private readonly EnqueueServiceInterface $ enqueueService ,
41
- private readonly SearchIndexServiceInterface $ searchIndexService ,
42
38
private readonly SettingsStoreServiceInterface $ settingsStoreService ,
43
39
) {
44
40
}
@@ -59,20 +55,11 @@ public function __invoke(UpdateClassMappingMessage $message): void
59
55
return ;
60
56
}
61
57
62
- $ alias = $ this ->dataObjectTypeAdapter ->getAliasIndexName ($ classDefinition );
63
- if (!$ this ->searchIndexService ->existsAlias ($ alias )) {
64
- $ this ->dataObjectMappingHandler
65
- ->updateMapping (
66
- context: $ classDefinition ,
67
- mappingProperties: $ mappingProperties
68
- );
69
- } else {
70
- $ this ->dataObjectMappingHandler
71
- ->reindexMapping (
72
- context: $ classDefinition ,
73
- mappingProperties: $ mappingProperties
74
- );
75
- }
58
+ $ this ->dataObjectMappingHandler
59
+ ->reindexMapping (
60
+ context: $ classDefinition ,
61
+ mappingProperties: $ mappingProperties
62
+ );
76
63
77
64
$ this ->settingsStoreService ->storeClassMapping (
78
65
classDefinitionId: $ classDefinition ->getId (),
0 commit comments