diff --git a/src/Service/Search/Schema2xFieldMapper.php b/src/Service/Search/Schema2xFieldMapper.php index 0498912..5071394 100644 --- a/src/Service/Search/Schema2xFieldMapper.php +++ b/src/Service/Search/Schema2xFieldMapper.php @@ -13,6 +13,7 @@ use Atoolo\Search\Dto\Search\Query\Facet\RelativeDateRangeFacet; use Atoolo\Search\Dto\Search\Query\Facet\SiteFacet; use Atoolo\Search\Dto\Search\Query\Filter\AbsoluteDateRangeFilter; +use Atoolo\Search\Dto\Search\Query\Filter\ArchiveFilter; use Atoolo\Search\Dto\Search\Query\Filter\CategoryFilter; use Atoolo\Search\Dto\Search\Query\Filter\ContentSectionTypeFilter; use Atoolo\Search\Dto\Search\Query\Filter\Filter; @@ -56,6 +57,8 @@ public function getFacetField(Facet $facet): string public function getFilterField(Filter $facet): string { switch (true) { + case $facet instanceof ArchiveFilter: + return 'sp_archive'; case $facet instanceof CategoryFilter: return 'sp_category_path'; case $facet instanceof ContentSectionTypeFilter: diff --git a/test/Service/Search/Schema2xFieldMapperTest.php b/test/Service/Search/Schema2xFieldMapperTest.php index 98ab08e..7c8404d 100644 --- a/test/Service/Search/Schema2xFieldMapperTest.php +++ b/test/Service/Search/Schema2xFieldMapperTest.php @@ -13,6 +13,7 @@ use Atoolo\Search\Dto\Search\Query\Facet\RelativeDateRangeFacet; use Atoolo\Search\Dto\Search\Query\Facet\SiteFacet; use Atoolo\Search\Dto\Search\Query\Filter\AbsoluteDateRangeFilter; +use Atoolo\Search\Dto\Search\Query\Filter\ArchiveFilter; use Atoolo\Search\Dto\Search\Query\Filter\CategoryFilter; use Atoolo\Search\Dto\Search\Query\Filter\ContentSectionTypeFilter; use Atoolo\Search\Dto\Search\Query\Filter\Filter; @@ -65,6 +66,7 @@ public static function getFacets(): array public static function getFilter(): array { return [ + [ ArchiveFilter::class, 'sp_archive' ], [ CategoryFilter::class, 'sp_category_path' ], [ ContentSectionTypeFilter::class, 'sp_contenttype' ], [ GroupFilter::class, 'sp_group_path' ],