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:
ConditionGroup Facets Block

Filter_Queries output:
Filter queries Facets Block

Facets Exposed Filters (wrong active facets and facet counts)

ConditionGroup structure:
ConditionGroups Exposed Filter Facets

Filter_Queries output:
Filter queries Exposed Filter Facets

It looks like either "reduceFilterQueries" is the culprit, or Solarium needs to handle the 2nd query better...

Comments

strykaizer created an issue. See original summary.

strykaizer’s picture

Issue summary: View changes
strykaizer’s picture

Issue summary: View changes
strykaizer’s picture

Project: Search API Solr » Facets
Version: 4.3.5 » 3.0.x-dev

As discussed, we'll fix this in facets_exposed_filters, by flattening out the nested conditiongroups

strykaizer’s picture

Status: Active » Needs review
StatusFileSize
new3.17 KB

  • strykaizer committed 73bf37ab on 3.0.x
    Issue #3485461 by strykaizer: Nested AND conditiongroups break facet...
strykaizer’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.