From ebafc0ab5688b7d684164699e72c211699238aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20=C5=A0panja?= Date: Wed, 29 May 2024 12:31:16 +0200 Subject: [PATCH] NGSTACK-836: restructure parent-child indexing field mapper --- .../{ => ContentTranslation}/ParentChildFieldMapper.php | 7 ++++--- .../ParentChildFieldMapper}/FullTextFieldResolver.php | 2 +- .../FullTextFieldResolver/NativeFulltextFieldResolver.php | 4 ++-- .../config/search/common/parent_child_indexing/common.yaml | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) rename lib/Core/Search/Solr/FieldMapper/{ => ContentTranslation}/ParentChildFieldMapper.php (97%) rename lib/Core/Search/Solr/FieldMapper/{ => ContentTranslation/ParentChildFieldMapper}/FullTextFieldResolver.php (72%) rename lib/Core/Search/Solr/FieldMapper/{ => ContentTranslation/ParentChildFieldMapper}/FullTextFieldResolver/NativeFulltextFieldResolver.php (90%) diff --git a/lib/Core/Search/Solr/FieldMapper/ParentChildFieldMapper.php b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper.php similarity index 97% rename from lib/Core/Search/Solr/FieldMapper/ParentChildFieldMapper.php rename to lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper.php index c6cd7f62..3a571d62 100644 --- a/lib/Core/Search/Solr/FieldMapper/ParentChildFieldMapper.php +++ b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper.php @@ -2,13 +2,14 @@ declare(strict_types=1); -namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper; +namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation; use Ibexa\Contracts\Core\Persistence\Content as SPIContent; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; use Ibexa\Contracts\Core\Persistence\Content\Handler as ContentHandler; -use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler; use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as LocationHandler; +use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler; +use Ibexa\Contracts\Core\Persistence\Filter\Content\Handler; use Ibexa\Contracts\Core\Repository\Exceptions\BadStateException; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; @@ -16,8 +17,8 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ParentLocationId; use Ibexa\Contracts\Core\Repository\Values\Filter\Filter; -use Ibexa\Contracts\Core\Persistence\Filter\Content\Handler; use Ibexa\Contracts\Solr\FieldMapper\ContentTranslationFieldMapper; +use Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper\FullTextFieldResolver; use function array_key_exists; use function array_keys; diff --git a/lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver.php b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver.php similarity index 72% rename from lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver.php rename to lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver.php index 973adc53..8a81e3ef 100644 --- a/lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver.php +++ b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper; +namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper; use Ibexa\Contracts\Core\Persistence\Content as SPIContent; diff --git a/lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php similarity index 90% rename from lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php rename to lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php index 39e1e1af..d4d0ae3c 100644 --- a/lib/Core/Search/Solr/FieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php +++ b/lib/Core/Search/Solr/FieldMapper/ContentTranslation/ParentChildFieldMapper/FullTextFieldResolver/NativeFulltextFieldResolver.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\FullTextFieldResolver; +namespace Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper\FullTextFieldResolver; use Ibexa\Contracts\Core\Persistence\Content as SPIContent; use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler; @@ -11,7 +11,7 @@ use Ibexa\Contracts\Core\Search\FieldType\FullTextField; use Ibexa\Contracts\Core\Search\FieldType\TextField; use Ibexa\Core\Search\Common\FieldRegistry; -use Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\FullTextFieldResolver; +use Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper\FullTextFieldResolver; final class NativeFulltextFieldResolver implements FullTextFieldResolver { diff --git a/lib/Resources/config/search/common/parent_child_indexing/common.yaml b/lib/Resources/config/search/common/parent_child_indexing/common.yaml index 75642cd1..34a514b4 100644 --- a/lib/Resources/config/search/common/parent_child_indexing/common.yaml +++ b/lib/Resources/config/search/common/parent_child_indexing/common.yaml @@ -1,6 +1,6 @@ services: netgen_search_extra.parent_child_indexing.parent_child_field_mapper: - class: Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ParentChildFieldMapper + class: Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper arguments: - '@netgen_search_extra.parent_child_indexing.fulltext_field_resolver' - '@Ibexa\Contracts\Core\Persistence\Content\Type\Handler' @@ -20,7 +20,7 @@ services: - '%netgen.ibexa_search_extra.parent_child_indexer%' netgen_search_extra.parent_child_indexing.fulltext_field_resolver.native: - class: Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\FullTextFieldResolver\NativeFulltextFieldResolver + class: Netgen\IbexaSearchExtra\Core\Search\Solr\FieldMapper\ContentTranslation\ParentChildFieldMapper\FullTextFieldResolver\NativeFulltextFieldResolver arguments: - '@Ibexa\Contracts\Core\Persistence\Content\Type\Handler' - '@Ibexa\Core\Search\Common\FieldRegistry'