Setup
- Solr version: 9.6.1
- Drupal Core version: 10.3.6
- Search API version: 8.x-1.35
- Search API Solr version: 4.3.5
- Configured Solr Connector: Solr Cloud with Basic Auth
Issue
When creating facets as block (both using 2.x and 3.x facets), there is only 1 conditiongroup in the query, which works as expected.
When creating facets as exposed filters, Views adds an extra nested AND conditiongroup.
This causes wrong active facets and facetcounts.
I debugged this in "src/Plugin/search_api/backend/SearchApiSolrBackend.php"
Here is an example of what happens when there are 2 facets, which both have 1 item active.
I created the exact same setup both with Facets Blocks, and Facets Exposed Filters
Facets as a block (works as expected)
ConditionGroup structure:

Filter_Queries output:

Facets Exposed Filters (wrong active facets and facet counts)
ConditionGroup structure:

Filter_Queries output:

It looks like either "reduceFilterQueries" is the culprit, or Solarium needs to handle the 2nd query better...
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3485461--5.patch | 3.17 KB | strykaizer |
Comments
Comment #2
strykaizerComment #3
strykaizerComment #4
strykaizerAs discussed, we'll fix this in facets_exposed_filters, by flattening out the nested conditiongroups
Comment #5
strykaizerComment #7
strykaizer