Combine Facets option does not work with Facets Exposed Filters

Created on 10 December 2024, 6 months ago

Problem/Motivation

The Combine Facets option does not work when using the Facets Exposed Filters submodule.

Steps to reproduce

Create a search index, and select several fields to be indexed.
Create a view based on the index.
In the Filter section of the view, click Add, select Facets from the category drop down, and select two or more of the facets (indexed fields). Click Add and Configure.
In the Settings, click Combine Facets.
What you ought to see now is the option to select which facets you want to combine. But in fact nothing gets displayed.

However, if you now define some facets using the old method (via /admin/config/search/facets/add-facet), and then go back again to the settings form for the facets in your view, and you again click Combine Facets, you will now be offered the list of facets that you've created in the old way. But even then, facet combination doesn't work properly.

It looks like the code for combining facets hasn't been updated to work with Facets Exposed Filters.

Proposed resolution

Modify the code for Combining Facets so that it works with Facets Exposed Filters.

Remaining tasks

Change the code. Test.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dabley
  • πŸ‡§πŸ‡ͺBelgium borisson_ Mechelen, πŸ‡§πŸ‡ͺ

    I don't know anything about combing facets, is this something that is built in or with another module? I think combination of values should happen at the Search API level?

    I may be missing something, but I'd like to get more info

  • @borisson, combining facets is a built in feature. It looks like it was introduced into v2 with #3268623: Combine facets into one facet β†’ .

  • Assigned to nidhish
  • πŸ‡ΊπŸ‡¦Ukraine khiminrm

    I've faced with the same issue. Would be nice to have this option for the facets exposed filters.
    I've found in Drupal\facets\Plugin\facets\processor\CombineFacetProcessor:

      public function supportsFacet(FacetInterface $facet) {
        // Only support facets as entities, not e.g. facets_exposed_filters.
        return $facet->getFacetType() == 'facet_entity';
      }

    So we need to create solution for the facets exposed filters.

    Will try to research...

Production build 0.71.5 2024