diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index 78d41df..29b6458 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -319,6 +319,16 @@ function _apachesolr_index_process_entity_get_document($entity, $entity_type) {
   if (!empty($path)) {
     $document->path = $path['path'];
     $document->url = url($path['path'], $path['options'] + array('absolute' => TRUE));
+    // Path aliases can have important information about the content.
+    // Add them to the index as well.
+    if (function_exists('drupal_get_path_alias')) {
+      // Add any path alias to the index, looking first for language specific
+      // aliases but using language neutral aliases otherwise.
+      $output = drupal_get_path_alias($document->path, $document->language);
+      if ($output && $output != $document->path) {
+        $document->path_alias = $output;
+      }
+    }
   }
   if (empty($entity->language)) {
     // 'und' is the language-neutral code in Drupal 7.
@@ -328,16 +338,6 @@ function _apachesolr_index_process_entity_get_document($entity, $entity_type) {
     $document->language = $entity->language;
   }
 
-  // Path aliases can have important information about the content.
-  // Add them to the index as well.
-  if (function_exists('drupal_get_path_alias')) {
-    // Add any path alias to the index, looking first for language specific
-    // aliases but using language neutral aliases otherwise.
-    $output = drupal_get_path_alias($document->path, $document->language);
-    if ($output && $output != $document->path) {
-      $document->path_alias = $output;
-    }
-  }
   return $document;
 }
 
