Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It looks like the OR filter operator for Entity Reference fields is not currently functional. Even a single selected field returns zero results, even though the count is accurate.
I'm using the following versions: Drupal 7.14, Apache Solr 7.x-1.0-rc3, Entity Reference 7.x-1.0-rc3, Facet API 7.x-1.2
Comment | File | Size | Author |
---|---|---|---|
#7 | apachesolr-or-filter-colons-entityreference-1803512-7.patch | 704 bytes | David_Rothstein |
#4 | Configure facet display.png | 84.23 KB | Paulmicha |
Comments
Comment #1
cpliakas CreditAttribution: cpliakas commentedHi amanire.
Thanks for the post and the details on your environment. Facet API doesn't actually perform the facet calculations, so this is most likely an issue with Apache Solr Search Integration. Switching to that project unless it is determined the root cause is somewhere in Facet API.
Thanks,
Chris
Comment #2
Nick_vhSupport for entity reference is a feature request.
Also please provide more information so we can reproduce
Comment #3
Nick_vhComment #4
Paulmicha CreditAttribution: Paulmicha commentedExact same issue here.
Versions : drupal-7.14, apachesolr-7.x-1.0-rc5 with the following patches applied : #1679392: Move logic from apachesolr_default_node_facet_info() into a separate function so other modules can use it for non-node entities and #1273658: Add the ability to filter by profile fields, apachesolr_user-7.x-1.x-dev, facetapi-7.x-1.1 and entityreference-7.x-1.0-rc3.
Steps to reproduce
In our case, it's been encoutered when searching for users :
Comment #5
Paulmicha CreditAttribution: Paulmicha commentedActually, should this be an issue for the Facet API module ? I'm looking at #1161434: Modify "query type" key in facet definition to accept an array and wondering if that's related (still searching).
Comment #6
cpliakas CreditAttribution: cpliakas commentedHi paul.michalet.
Probably not. Unless there is some specific piece of code you can point to or debugging that highlights Facet APi as being the problem, I would stick with debugging the Apache Solr Search Integration module. Facet API does not set the parameters on the backend, nor does it do the facet calculations. I am open a bug being in Facet API, however with issues like this is it usually an issue with the backend.
Thanks,
Chris
Comment #7
David_Rothstein CreditAttribution: David_Rothstein commentedThis seems to be because entity reference facets use values like "node:133" but the colon has a special meaning in Solr.
Based on discussion in #1154770: Must double quote filter query values if containing space or colon. it seems like code which adds the filter to the query should be responsible for fixing it (by quoting the value so Solr doesn't get confused). Conveniently there's already some very similar code there which we can reuse.
Comment #8
Paulmicha CreditAttribution: Paulmicha commentedMany thanks David !
This patch http://drupal.org/files/apachesolr-or-filter-colons-entityreference-1803... solved our issue.
Comment #9
Nick_vhCommitted to 7.x-1.x, thanks!
Comment #10
pwolanin CreditAttribution: pwolanin commented