diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index 5556d7a..f6ef2d5 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -1166,7 +1166,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 95e2f30..becb11e 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -2142,14 +2142,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);
     }
   }
