Skip to content

Commit

Permalink
fix: add ArchiveFilter field mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed May 6, 2024
1 parent 743634b commit 96902df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Service/Search/Schema2xFieldMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions test/Service/Search/Schema2xFieldMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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' ],
Expand Down

0 comments on commit 96902df

Please sign in to comment.