This is a problem both of the Facets module and the Solr module's facet integration.
The cause is that I concentrated a bit too much on the Solr side and adapted the Facets module code. The result for boolean facets is that facet filters will, contrary to the whole rest of the Search API, use "true"/"false" as values, instead of 1/0.
Also, completely unrelated, the if ($filter) check on line 602/611 of facets.module will be false for 0 values. Something like if ($filter || is_numeric($filter)) or if (strlen($filter)) should be used.
Results:
- For DB-based facets (and all other correct ones, using 1/0 as filters), "False" is used to label both facet terms.
- With correct facet terms, the "false" facet link also won't work.
- Even for the Solr-based facets, this doesn't work, since the "false" string will be interpreted as TRUE/1 by the Solr search() method (that correctly works with 1/0).
Comments
Comment #1
fagohm, the entity API documents to use true/false, but it's not followed everywhere yet. See #1071814: Type of boolean fields is int
Comment #2
drunken monkeyWhether it's TRUE/FALSE or 1/0 doesn't matter, since they will both behave similar in most cases. What is wrong here is coding for "true"/"false", which simply doesn't occur anywhere outside Solr (at least in the Search API system).
Comment #3
drunken monkeyFixes for both the Facets and the Solr search modules were committed.