diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index 7f39d76..7f7999d 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -1367,7 +1367,7 @@ function apachesolr_entityreference_indexing_callback($entity, $field_name, $ind
       if ($id = (!empty($reference['target_id'])) ? $reference['target_id'] : FALSE) {
         $fields[] = array(
           'key' => $index_key,
-          'value' => $entity_type . ':' . $id,
+          'value' => apachesolr_document_id($id, $entity_type),
         );
       }
     }
diff --git a/apachesolr.module b/apachesolr.module
index b7556f3..6ab0066 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -2426,14 +2426,14 @@ function apachesolr_entityreference_facet_map_callback(array $values, array $opt
   // Gathers entity ids so we can load multiple entities at a time.
   $entity_ids = array();
   foreach ($values as $value) {
-    list($entity_type, $id) = explode(':', $value);
+    list($hash, $entity_type, $id) = explode('/', $value);
     $entity_ids[$entity_type][] = $id;
   }
   // Loads and maps entities.
   foreach ($entity_ids as $entity_type => $ids) {
     $entities = entity_load($entity_type, $ids);
     foreach ($entities as $id => $entity) {
-      $key = $entity_type . ':' . $id;
+      $key = $hash . '/' . $entity_type . '/' . $id;
       $map[$key] = entity_label($entity_type, $entity);
     }
   }
