diff --git a/src/Plugin/facets/query_type/SearchApiString.php b/src/Plugin/facets/query_type/SearchApiString.php index fab8010..7796041 100644 --- a/src/Plugin/facets/query_type/SearchApiString.php +++ b/src/Plugin/facets/query_type/SearchApiString.php @@ -75,7 +75,7 @@ class SearchApiString extends QueryTypePluginBase { if (!empty($this->results)) { $facet_results = array(); foreach ($this->results as $result) { - if ($result['count']) { + if ($result['count'] || $this->facet->getQueryOperator() == 'OR') { $facet_results[] = new Result(trim($result['filter'], '"'), trim($result['filter'], '"'), $result['count']); } } diff --git a/src/Plugin/facets/widget/CheckboxWidget.php b/src/Plugin/facets/widget/CheckboxWidget.php index 6d8bf49..2ca872b 100644 --- a/src/Plugin/facets/widget/CheckboxWidget.php +++ b/src/Plugin/facets/widget/CheckboxWidget.php @@ -52,18 +52,16 @@ class CheckboxWidget implements WidgetInterface { $show_numbers = (bool) $configuration['show_numbers']; foreach ($results as $result) { - if ($result->getCount()) { - // Get the link. - $text = $result->getDisplayValue(); - if ($show_numbers) { - $text .= ' (' . $result->getCount() . ')'; - } - if ($result->isActive()) { - $text = '(-) ' . $text; - } - $link = $this->linkGenerator()->generate($text, $result->getUrl()); - $items[] = $link; + // Get the link. + $text = $result->getDisplayValue(); + if ($show_numbers) { + $text .= ' (' . $result->getCount() . ')'; } + if ($result->isActive()) { + $text = '(-) ' . $text; + } + $link = $this->linkGenerator()->generate($text, $result->getUrl()); + $items[] = $link; } $build = [ '#theme' => 'item_list', diff --git a/src/Plugin/facets/widget/LinksWidget.php b/src/Plugin/facets/widget/LinksWidget.php index 196cd5e..88e1a15 100644 --- a/src/Plugin/facets/widget/LinksWidget.php +++ b/src/Plugin/facets/widget/LinksWidget.php @@ -52,22 +52,20 @@ class LinksWidget implements WidgetInterface { $show_numbers = (bool) $configuration['show_numbers']; foreach ($results as $result) { - if ($result->getCount()) { - // Get the link. - $text = $result->getDisplayValue(); - if ($show_numbers) { - $text .= ' (' . $result->getCount() . ')'; - } - if ($result->isActive()) { - $text = '(-) ' . $text; - } - - if (is_null($result->getUrl())) { - $items[] = $text; - } - else { - $items[] = $this->linkGenerator()->generate($text, $result->getUrl()); - } + // Get the link. + $text = $result->getDisplayValue(); + if ($show_numbers) { + $text .= ' (' . $result->getCount() . ')'; + } + if ($result->isActive()) { + $text = '(-) ' . $text; + } + + if (is_null($result->getUrl())) { + $items[] = $text; + } + else { + $items[] = $this->linkGenerator()->generate($text, $result->getUrl()); } }