diff --git a/apachesolr.module b/apachesolr.module
index 6e2105c..e8f7fbe 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -1813,15 +1813,15 @@ function apachesolr_get_indexer_table($type) {
  *
  * @see apachesolr_node_delete().
  */
-function apachesolr_entity_delete($entity_id, $entity_type) {
+function apachesolr_entity_delete($entity, $entity_type) {
   $env_id = apachesolr_default_environment();
    module_load_include('inc', 'apachesolr', 'apachesolr.index');
-  if (apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entity_id)) {
+  if (apachesolr_index_delete_entity_from_index($env_id, $entity_type, $entity->entity_id)) {
     // There was no exception, so delete from the table.
     $indexer_table = apachesolr_get_indexer_table($entity_type);
     db_delete($indexer_table)
       ->condition('entity_type', $entity_type)
-      ->condition('entity_id', $entity_id)
+      ->condition('entity_id', $entity->entity_id)
       ->execute();
   }
 }
