diff --git a/lib/Core/Search/Common/Messenger/MessageHandler/Search/DescendantIndexing/AncestorPathGenerator.php b/lib/Core/Search/Common/Messenger/MessageHandler/Search/DescendantIndexing/AncestorPathGenerator.php index 3d8f2b99..1ddeb47b 100644 --- a/lib/Core/Search/Common/Messenger/MessageHandler/Search/DescendantIndexing/AncestorPathGenerator.php +++ b/lib/Core/Search/Common/Messenger/MessageHandler/Search/DescendantIndexing/AncestorPathGenerator.php @@ -127,7 +127,7 @@ private function recursiveNormalizeConfiguration(array $config): array $normalizedConfig = []; foreach ($config as $key => $value) { - if ($key === 'indexed') { + if ($key === 'indexed' || $key === 'handlers') { continue; } diff --git a/lib/Core/Search/Solr/FieldMapper/Block/DescendantFieldMapper/BaseFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/Block/DescendantFieldMapper/BaseFieldMapper.php index b25b6dba..ed953b81 100644 --- a/lib/Core/Search/Solr/FieldMapper/Block/DescendantFieldMapper/BaseFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/Block/DescendantFieldMapper/BaseFieldMapper.php @@ -35,7 +35,7 @@ private function internalAccept(Content $content): bool $contentType = $this->contentTypeHandler->load($content->versionInfo->contentInfo->contentTypeId); $map = $this->configuration['map'] ?? []; - $handlers = $this->configuration['handlers'] ?? []; + $handlers = $map[$contentType->identifier]['handlers'] ?? []; return array_key_exists($contentType->identifier, $map) && in_array($this->getIdentifier(), $handlers, true); diff --git a/lib/Core/Search/Solr/FieldMapper/BlockTranslation/DescendantFieldMapper/BaseFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/BlockTranslation/DescendantFieldMapper/BaseFieldMapper.php index 84f87e0c..cfa63079 100644 --- a/lib/Core/Search/Solr/FieldMapper/BlockTranslation/DescendantFieldMapper/BaseFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/BlockTranslation/DescendantFieldMapper/BaseFieldMapper.php @@ -35,7 +35,7 @@ private function internalAccept(Content $content): bool $contentType = $this->contentTypeHandler->load($content->versionInfo->contentInfo->contentTypeId); $map = $this->configuration['map'] ?? []; - $handlers = $this->configuration['handlers'] ?? []; + $handlers = $map[$contentType->identifier]['handlers'] ?? []; return array_key_exists($contentType->identifier, $map) && in_array($this->getIdentifier(), $handlers, true); diff --git a/lib/Core/Search/Solr/FieldMapper/Content/DescendantFieldMapper/BaseFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/Content/DescendantFieldMapper/BaseFieldMapper.php index b48b0b82..3ea49a23 100644 --- a/lib/Core/Search/Solr/FieldMapper/Content/DescendantFieldMapper/BaseFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/Content/DescendantFieldMapper/BaseFieldMapper.php @@ -35,7 +35,7 @@ private function internalAccept(Content $content): bool $contentType = $this->contentTypeHandler->load($content->versionInfo->contentInfo->contentTypeId); $map = $this->configuration['map'] ?? []; - $handlers = $this->configuration['handlers'] ?? []; + $handlers = $map[$contentType->identifier]['handlers'] ?? []; return array_key_exists($contentType->identifier, $map) && in_array($this->getIdentifier(), $handlers, true); diff --git a/lib/Core/Search/Solr/FieldMapper/ContentTranslation/DescendantFieldMapper/BaseFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/DescendantFieldMapper/BaseFieldMapper.php index c578a487..48df3b33 100644 --- a/lib/Core/Search/Solr/FieldMapper/ContentTranslation/DescendantFieldMapper/BaseFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/DescendantFieldMapper/BaseFieldMapper.php @@ -35,7 +35,8 @@ private function internalAccept(Content $content): bool $contentType = $this->contentTypeHandler->load($content->versionInfo->contentInfo->contentTypeId); $map = $this->configuration['map'] ?? []; - $handlers = $this->configuration['handlers'] ?? []; + + $handlers = $map[$contentType->identifier]['handlers'] ?? []; return array_key_exists($contentType->identifier, $map) && in_array($this->getIdentifier(), $handlers, true); diff --git a/lib/Core/Search/Solr/FieldMapper/Location/DescendantFieldMapper/BaseFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/Location/DescendantFieldMapper/BaseFieldMapper.php index b85932aa..2468e795 100644 --- a/lib/Core/Search/Solr/FieldMapper/Location/DescendantFieldMapper/BaseFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/Location/DescendantFieldMapper/BaseFieldMapper.php @@ -38,7 +38,7 @@ private function internalAccept(Location $location): bool $contentType = $this->contentTypeHandler->load($contentInfo->contentTypeId); $map = $this->configuration['map'] ?? []; - $handlers = $this->configuration['handlers'] ?? []; + $handlers = $map[$contentType->identifier]['handlers'] ?? []; return array_key_exists($contentType->identifier, $map) && in_array($this->getIdentifier(), $handlers, true); diff --git a/tests/lib/Integration/Resources/config/event_dispatcher_override_asynchronous.yaml b/tests/lib/Integration/Resources/config/event_dispatcher_override_asynchronous.yaml index e062d75a..b5514c18 100644 --- a/tests/lib/Integration/Resources/config/event_dispatcher_override_asynchronous.yaml +++ b/tests/lib/Integration/Resources/config/event_dispatcher_override_asynchronous.yaml @@ -1,13 +1,13 @@ parameters: netgen.ibexa_search_extra.descendant_indexing.configuration: enabled: true - handlers: - - ng_descendant_indexing_fulltext - - ng_descendant_indexing_location_priority - - ng_descendant_indexing_section - - ng_descendant_indexing_object_state map: descendant_indexing_test: + handlers: + - ng_descendant_indexing_fulltext + - ng_descendant_indexing_location_priority + - ng_descendant_indexing_section + - ng_descendant_indexing_object_state children: descendant_indexing_test_2: indexed: true