function apachesolr_index_node_status_callback in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 apachesolr.index.inc \apachesolr_index_node_status_callback()
- 7 apachesolr.index.inc \apachesolr_index_node_status_callback()
Status callback for ApacheSolr, for nodes.
2 string references to 'apachesolr_index_node_status_callback'
- apachesolr_get_index_callbacks in ./
apachesolr.module - Return a set of callbacks for indexing a node
- hook_apachesolr_entity_info_alter in ./
apachesolr.api.php - Add information to index other entities. There are some modules in http://drupal.org that can give a good example of custom entity indexing such as apachesolr_user, apachesolr_term
File
- ./
apachesolr.index.inc, line 920 - Functions related to Apache Solr indexing operations.
Code
function apachesolr_index_node_status_callback($entity_id, $entity_type) {
// Make sure we have a boolean value.
// Anything different from 1 becomes zero
$node_status = db_result(db_query("SELECT n.status FROM {node} n WHERE nid = %d", array(
$entity_id,
)));
$status = $node_status == 1 ? 1 : 0;
return $status;
}