function apachesolr_entity_should_index in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 apachesolr.module \apachesolr_entity_should_index()
- 7 apachesolr.module \apachesolr_entity_should_index()
Determines if we should index the provided entity.
Whether or not a given entity is indexed is determined on a per-bundle basis. Entities/Bundles that have no index flag are presumed to not get indexed.
Parameters
stdClass $entity: The entity we may or may not want to index.
string $type: The type of entity.
Return value
boolean TRUE if this entity should be indexed, FALSE otherwise.
1 call to apachesolr_entity_should_index()
- apachesolr_entity_update in ./
apachesolr.module - Helper function for the hook_nodeapi().
File
- ./
apachesolr.module, line 1947 - Integration with the Apache Solr search application.
Code
function apachesolr_entity_should_index($entity, $type) {
$info = content_types();
$id = $entity->nid;
$bundle = $entity->type;
$env_id = apachesolr_default_environment();
$bundles = apachesolr_get_index_bundles($env_id, 'node');
if ($bundle && isset($info[$bundle]['extra']['apachesolr']['index']) && $info[$bundle]['extra']['apachesolr']['index']) {
return TRUE;
}
return FALSE;
}