- Issue created by @Kasey_MK
- π©πͺGermany mkalkbrenner π©πͺ
This sounds like a bug in Core or Search API's Views plugin.
The filed is a boolean and therefore it is correctly mapped for the index.
search_api_solr and Drupal core seem to disagree about whether an entity's status is stored as a boolean or a string - or maybe search_api_solr could allow a little more fuzziness in evaluating booleans?
Don't use the Entity status processor on your search index.
Add the "Published" field to your search index (machine name status). It will default to field type "Boolean".
Add a filter to your search View on the Published field. It will look like a boolean field, and let you filter by "Published is equal to True" (or False).
Use the command line interface to run drush cron
to reindex your content. On a large volume of content (~17,000 nodes) we started getting a "Too many clauses in boolean query" (and increasing maxBooleanClauses didn't help).
Upon inspection, the view configuration was saving the status filter value as '1'
or '0'
(strings) - not 1
or 0
(integers) and not true
or false
(boolean).
Changing the field type for the status field in the search index to "Integer" didn't work, but changing it to "String" (and recreating the filter on the view to accommodate) did let the content finish reindexing with a working filter on the view.
We realized after figuring that out that it was a bad idea for us to index unpublished content anyway (we'll handle showing staff unpublished content using a simple Drupal-based View instead of bloating our Solr indexes), but I thought I should report this finding in case it's tripping anyone else up.
Active
1.0
General code
This sounds like a bug in Core or Search API's Views plugin.
The filed is a boolean and therefore it is correctly mapped for the index.