diff --git a/apachesolr_attachments.index.inc b/apachesolr_attachments.index.inc
index 86b3c50..e0b90c8 100644
--- a/apachesolr_attachments.index.inc
+++ b/apachesolr_attachments.index.inc
@@ -195,6 +195,12 @@ function apachesolr_attachments_add_file_usage(stdClass $stub_file, $parent_enti
     // bundle type, and media adds many bundles, so fixing this here
     $file = file_load($stub_file->fid);
     $indexer_table = apachesolr_get_indexer_table('file');
+    // For non-media files there is no such thing as a defined type/bundle
+    // Define it here, so we can have a seamless integration between media and
+    // non-media
+    if (empty($file->type)) {
+      $file->type = 'file';
+    }
     db_merge($indexer_table)
       ->key(array(
         'entity_type' => 'file',
diff --git a/apachesolr_attachments.module b/apachesolr_attachments.module
index b4fc02e..1f71714 100644
--- a/apachesolr_attachments.module
+++ b/apachesolr_attachments.module
@@ -188,7 +188,11 @@ function apachesolr_attachments_solr_reindex() {
       foreach ($parent_entities as $parent_entity_info) {
         // Fake our file class
         $file = new stdClass();
-        $file->fid = $parent_entity_info->extraFields->field_file_fid;
+        foreach ($parent_entity_info->extraFields as $key => $value) {
+          if (strpos($key, '_fid')) {
+            $file->fid = $parent_entity_info->extraFields->$key;
+          }
+        }
         list ($parent_entity_id) = entity_extract_ids($parent_entity_type, $parent_entity_info);
         apachesolr_attachments_add_file_usage($file, $parent_entity_type, $parent_entity_id);
       }
