diff --git a/apachesolr.module b/apachesolr.module
index 058b528..98ed320 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -1847,6 +1847,7 @@ function apachesolr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  * Helper function for the hook_nodeapi().
  */
 function apachesolr_entity_update($entity, $type) {
+  module_load_include('inc', 'apachesolr', 'apachesolr.index');
   if (apachesolr_entity_should_index($entity, $type)) {
     $id = $entity->nid;
     $bundle = $entity->type;
@@ -1899,7 +1900,7 @@ function apachesolr_get_indexer_table($type) {
  */
 function apachesolr_entity_delete($entity_id, $entity_type) {
   $env_id = apachesolr_default_environment();
-   module_load_include('inc', 'apachesolr', 'apachesolr.index');
+  module_load_include('inc', 'apachesolr', 'apachesolr.index');
   if (apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entity_id)) {
     // There was no exception, so delete from the table.
     $indexer_table = apachesolr_get_indexer_table($entity_type);
