The function apachesolr_index_node_solr_reindex() makes database calls to the node table, but the table name is not properly wrapped in curly brackets, so it doesn't work for prefixed tables.
Lines 831-849 of apachesolr.index.inc:
<?php
...
if ($bundle) {
// Leave status 0 rows - those need to be
// removed from the index later.
db_query("DELETE FROM {{$indexer_table}} WHERE entity_type = 'node' AND bundle = '%s' AND status = 1", array($bundle));
// Mark all nodes of the specified content type for reindexing.
$query = "INSERT INTO {{$indexer_table}} (entity_id, bundle, status, entity_type, changed) (
SELECT n.nid AS entity_id, n.type AS bundle, n.status AS status, 'node' AS entity_type, %d AS changed
FROM node n WHERE n.type = '%s' AND status = 1)";
db_query($query, array(APACHESOLR_REQUEST_TIME, $bundle));
}
else {
// Leave status 0 rows - those need to be
// removed from the index later.
db_query("DELETE FROM {{$indexer_table}} WHERE entity_type = 'node' AND status = 1");
$query = "INSERT INTO {{$indexer_table}} (entity_id, bundle, status, entity_type, changed) (
SELECT n.nid AS entity_id, n.type AS bundle, n.status AS status, 'node' AS entity_type, %d AS changed
FROM node n WHERE status = 1)";
db_query($query, array(APACHESOLR_REQUEST_TIME));
}
...
?>
Comments
Comment #1
m.stentaAttached is a simple patch that fixes the issue.
Comment #2
kevin.dutra commentedThis is a pretty innocuous change, so I'm going to mark this RTBC.
Comment #3
pwolanin commentedcommitted, thanks