You are here

function apachesolr_entity_should_index in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_entity_should_index()
  2. 6.3 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.

2 calls to apachesolr_entity_should_index()
apachesolr_entity_delete in ./apachesolr.module
Implements hook_entity_delete().
apachesolr_entity_update in ./apachesolr.module
Implements hook_entity_update().

File

./apachesolr.module, line 1993
Integration with the Apache Solr search application.

Code

function apachesolr_entity_should_index($entity, $type) {
  $info = entity_get_info($type);
  list($id, $vid, $bundle) = entity_extract_ids($type, $entity);
  if ($bundle && isset($info['bundles'][$bundle]['apachesolr']['index']) && $info['bundles'][$bundle]['apachesolr']['index']) {
    return TRUE;
  }
  return FALSE;
}