From 58bf04e309846d7dd772a36d05b899a3d82838b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Thu, 3 Sep 2020 09:09:26 +0200 Subject: [PATCH] fixup! EZP-27458: Impl. Aggregation API --- .../CountryFieldTermAggregationFieldResolver.php | 2 +- .../config/container/solr/aggregation_visitors.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Query/Common/AggregationVisitor/AggregationFieldResolver/CountryFieldTermAggregationFieldResolver.php b/lib/Query/Common/AggregationVisitor/AggregationFieldResolver/CountryFieldTermAggregationFieldResolver.php index bdd2dbd1c..a6d557b45 100644 --- a/lib/Query/Common/AggregationVisitor/AggregationFieldResolver/CountryFieldTermAggregationFieldResolver.php +++ b/lib/Query/Common/AggregationVisitor/AggregationFieldResolver/CountryFieldTermAggregationFieldResolver.php @@ -45,7 +45,7 @@ private function getSearchFieldName(CountryTermAggregation $aggregation): string case CountryTermAggregation::TYPE_NAME: return 'name'; case CountryTermAggregation::TYPE_ALPHA_2: - return 'aplha2'; + return 'alpha2'; case CountryTermAggregation::TYPE_ALPHA_3: return 'alpha3'; case CountryTermAggregation::TYPE_IDC: diff --git a/lib/Resources/config/container/solr/aggregation_visitors.yml b/lib/Resources/config/container/solr/aggregation_visitors.yml index f8b4cd080..cfe5d39d2 100644 --- a/lib/Resources/config/container/solr/aggregation_visitors.yml +++ b/lib/Resources/config/container/solr/aggregation_visitors.yml @@ -76,12 +76,15 @@ services: - { name: ezplatform.search.solr.query.content.aggregation_visitor } - { name: ezplatform.search.solr.query.location.aggregation_visitor } + EzSystems\EzPlatformSolrSearchEngine\Query\Common\AggregationVisitor\AggregationFieldResolver\CountryFieldTermAggregationFieldResolver: + arguments: + $fieldNameResolver: '@ezpublish.search.common.field_name_resolver' + ezpublish.search.solr.query.common.aggregation_visitor.field.country_term: class: EzSystems\EzPlatformSolrSearchEngine\Query\Common\AggregationVisitor\TermAggregationVisitor - factory: ['@EzSystems\EzPlatformSolrSearchEngine\Query\Common\AggregationVisitor\Factory\ContentFieldAggregationVisitorFactory', 'createTermAggregationVisitor'] arguments: $aggregationClass: 'eZ\Publish\API\Repository\Values\Content\Query\Aggregation\Field\CountryTermAggregation' - $searchIndexFieldName: 'alpha2' + $aggregationFieldResolver: '@EzSystems\EzPlatformSolrSearchEngine\Query\Common\AggregationVisitor\AggregationFieldResolver\CountryFieldTermAggregationFieldResolver' tags: - { name: ezplatform.search.solr.query.content.aggregation_visitor } - { name: ezplatform.search.solr.query.location.aggregation_visitor }