diff --git a/apachesolr.api.php b/apachesolr.api.php
index d81306b..e5e2263 100644
--- a/apachesolr.api.php
+++ b/apachesolr.api.php
@@ -194,17 +194,53 @@ function hook_apachesolr_delete_by_query_alter($query) {
     $query .= ' AND hash:' . apachesolr_site_hash();
   }
 }
+/*
+ * This is the place to look for the replacement to hook_apachesolr_node_exclude
+ * You should define a replacement for the status callback and return
+ * FALSE for entities which you do not want to appear in the index and TRUE for
+ * those that you want to include
+ */
+
+/**
+ * This is invoked for each entity that is being inspected to be added to the
+ * index. if any module returns TRUE, the entity is skipped for indexing.
+ *
+ * @param integer $entity_id
+ * @param string $entity_type
+ * @param string $env_id
+ * @return boolean
+ */
+function hook_apachesolr_exclude($entity_id, $entity_type, $env_id) {
+  // Never index media entities to core_1
+  if ($entity_type == 'media' && $env_id == 'core_1') {
+    return TRUE;
+  }
+  return FALSE;
+}
+
+/**
+ * This is invoked for each entity from the type of ENTITY_TYPE that is being
+ * inspected to be added to the index. if any module returns TRUE, 
+ * the entity is skipped for indexing.
+ *
+ * @param integer $entity_id
+ * @param string $entity_type
+ * @param string $env_id
+ * @return boolean
+ */
+function hook_apachesolr_exclude_ENTITY_TYPE($entity_id, $env_id) {
+  // Never index ENTITY_TYPE to core_1
+  if ($env_id == 'core_1') {
+    return TRUE;
+  }
+  return FALSE;
+}
 
 /**
  * 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_indexer, apachesolr_term
  *
- * This is the place to look for the replacement to hook_apachesolr_node_exclude
- * You should define a replacement for the status callback and return
- * 0 for nodes which you do not want to appear in the index and 1 for nodes
- * that you do. See http://drupal.org/node/1474906 for an example.
- *
  * @param array $entity_info
  */
 function hook_apachesolr_entity_info_alter(&$entity_info) {
diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index ea8d2a2..d3949f8 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -17,7 +17,25 @@ function apachesolr_index_entities($env_id, $limit) {
     $documents = array();
     foreach ($rows as $row) {
       if (!empty($row->status)) {
-        $documents = array_merge($documents, apachesolr_index_entity_to_documents($row, $env_id));
+        // Let any module exclude this entity from the index.
+        $build_document = TRUE;
+        foreach (module_implements('apachesolr_exclude') as $module) {
+          $exclude = module_invoke($module, 'apachesolr_exclude', $row->entity_id, $entity_type, $env_id);
+          // If the hook returns TRUE we should exclude the entity
+          if (!empty($exclude)) {
+            $build_document = FALSE;
+          }
+        }
+        foreach (module_implements('apachesolr_exclude' . $entity_type) as $module) {
+          $exclude = module_invoke($module, 'apachesolr_exclude' . $entity_type, $row->entity_id, $env_id);
+          // If the hook returns TRUE we should exclude the entity
+          if (!empty($exclude)) {
+            $build_document = FALSE;
+          }
+        }
+        if ($build_document) {
+          $documents = array_merge($documents, apachesolr_index_entity_to_documents($row, $env_id));
+        }
       }
       else {
         // Delete the entity from our index if the status callback returned 0
