diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 827b720b9a494a8e30eecb774268e0fd1b469486..2aa2cb0e455ec63181c5f7cfd9a16970f012c06a 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -350,8 +350,16 @@ class Results extends \VuFind\Search\Base\Results $limit = 50; } $params->resetFacetConfig(); + if (null !== $facetSort && 'count' !== $facetSort) { + throw new \Exception("$facetSort facet sort not supported by Summon."); + } foreach ($facetfields as $facet) { $params->addFacet($facet . ',or,' . $page . ',' . $limit); + + // Clear existing filters for the selected field if necessary: + if ($removeFilter) { + $params->removeAllFilters($facet); + } } $params = $params->getBackendParameters(); $collection = $this->getSearchService()->search(