diff --git a/apachesolr_attachments.admin.inc b/apachesolr_attachments.admin.inc
index 06a86bc..9fdc2ca 100644
--- a/apachesolr_attachments.admin.inc
+++ b/apachesolr_attachments.admin.inc
@@ -95,6 +95,36 @@ function apachesolr_attachments_settings_submit($form, &$form_state) {
 }
 
 /**
+ * Form callback for content type settings.
+*/
+function apachesolr_attachments_entity_bundle_settings() {
+  $env_id = apachesolr_default_environment();
+
+  foreach (entity_get_info() as $entity_type => $entity_info) {
+    if (!empty($entity_info['apachesolr']['indexable'])) {
+      $indexed_bundles = apachesolr_get_index_bundles($env_id, $entity_type);
+
+      foreach ($indexed_bundles as $bundle) {
+        if ($bundle != 'file') {
+          $form['apachesolr_attachments_entity_bundle_indexing_' . $bundle] = array(
+            '#type' => 'select',
+            '#title' => $bundle,
+            '#default_value' => variable_get('apachesolr_attachments_entity_bundle_indexing_' . $bundle, 'seperate'),
+            '#options' => array(
+              'seperate' => t('Attachments as separate entities'),
+              'parent' => t('Attachments as part of parent entity'),
+              'none' => t("Don't index attachments"),
+            ),
+          );
+        }
+      }
+    }
+  }
+
+  return system_settings_form($form);
+}
+
+/**
  * Form builder for the Apachesolr Attachments actions form.
  *
  */
diff --git a/apachesolr_attachments.index.inc b/apachesolr_attachments.index.inc
index d9c80ff..242787a 100644
--- a/apachesolr_attachments.index.inc
+++ b/apachesolr_attachments.index.inc
@@ -87,7 +87,7 @@ function apachesolr_attachments_get_attachment_text($file) {
     }
     catch (Exception $e) {
       // Exceptions from Solr may be transient, or indicate a problem with a specific file.
-      watchdog('Apache Solr Attachments', "Exception occurred sending %filepath to Solr\n!message", array('%filepath' => $file->uri, '!message' => nl2br(check_plain($e->getMessage()))), WATCHDOG_ERROR);
+      watchdog('Apache Solr Attachments', "Exception occurred sending %filepath to Solr\n!message", array('%filepath' => $filepath, '!message' => nl2br(check_plain($e->getMessage()))), WATCHDOG_ERROR);
       return FALSE;
     }
   }
diff --git a/apachesolr_attachments.install b/apachesolr_attachments.install
index 1bd0592..5906b3f 100644
--- a/apachesolr_attachments.install
+++ b/apachesolr_attachments.install
@@ -20,6 +20,10 @@ function apachesolr_attachments_uninstall() {
   variable_del('apachesolr_attachments_excluded_extensions');
   variable_del('apachesolr_attachments_extract_using');
   variable_del('apachesolr_attachments_excluded_mime');
+
+  db_delete('variable')
+    ->condition('name', db_like('apachesolr_attachments_enity_bundle_indexing_') , '%', 'LIKE')
+    ->execute();
 }
 
 /**
diff --git a/apachesolr_attachments.module b/apachesolr_attachments.module
index 1f07913..4081847 100644
--- a/apachesolr_attachments.module
+++ b/apachesolr_attachments.module
@@ -43,6 +43,20 @@ function apachesolr_attachments_menu() {
     'file' => 'apachesolr_attachments.admin.inc',
     'type' => MENU_CALLBACK,
   );
+  $items['admin/config/search/apachesolr/attachments/general'] = array(
+    'title' => 'General',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+  );
+  $items['admin/config/search/apachesolr/attachments/entity_bundle'] = array(
+    'title' => 'Bundle',
+    'description' => 'Administer Apache Solr Attachments per bundle settings.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('apachesolr_attachments_entity_bundle_settings'),
+    'access arguments' => array('administer search'),
+    'file' => 'apachesolr_attachments.admin.inc',
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 1,
+  );
   return $items;
 }
 
@@ -58,6 +72,8 @@ function apachesolr_attachments_apachesolr_entity_info_alter(&$entity_info) {
   $entity_info['file']['reindex callback'] = 'apachesolr_attachments_solr_reindex';
   $entity_info['file']['index_table'] = 'apachesolr_index_entities_file';
   $entity_info['file']['result callback'] = 'apachesolr_attachments_file_result';
+
+  $entity_info['node']['document callback'][] = 'apachesolr_attachments_node_solr_document';
 }
 
 /**
@@ -74,7 +90,6 @@ function apachesolr_attachments_solr_document(ApacheSolrDocument $document, $fil
   module_load_include('inc', 'apachesolr_attachments', 'apachesolr_attachments.index');
   $documents = array();
 
-
   $text = apachesolr_attachments_get_attachment_text($file);
   // Text is saved in the index table. Will be used by the node indexing if
   // available.
@@ -96,52 +111,110 @@ function apachesolr_attachments_solr_document(ApacheSolrDocument $document, $fil
           continue;
         }
 
-        // Get a clone of the bare minimum document
-        $filedocument = clone $document;
-
-        //Get the callback array to add stuff to the document
-        $callbacks = apachesolr_entity_get_callback($parent_entity_type, 'document callback');
-        $build_documents = array();
-        foreach ($callbacks as $callback) {
-          // Call a type-specific callback to add stuff to the document.
-          $build_documents = array_merge($build_documents, $callback($filedocument, $parent_entity, $parent_entity_type, $env_id));
-        }
+        // fetch the bundle
+        list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids('node', $parent_entity);
+
+        // proceed with building this document only if the parent entity is not flagged for
+        //indexing attachments with parent entity or not indexing attachements
+        if (variable_get('apachesolr_attachments_entity_bundle_indexing_' . $parent_entity_bundle, 'seperate') == 'seperate') {
+          // Get a clone of the bare minimum document
+          $filedocument = clone $document;
+
+          //Get the callback array to add stuff to the document
+          $callbacks = apachesolr_entity_get_callback($parent_entity_type, 'document callback');
+          $build_documents = array();
+          foreach ($callbacks as $callback) {
+            // Call a type-specific callback to add stuff to the document.
+            $build_documents = array_merge($build_documents, $callback($filedocument, $parent_entity, $parent_entity_type, $env_id));
+          }
 
-        // Take the top document from the stack
-        $filedocument = reset($build_documents);
+          // Take the top document from the stack
+          $filedocument = reset($build_documents);
 
-        // Build our separate document and overwrite basic information
-        $filedocument->id = apachesolr_document_id($file->fid . '-' . $parent_entity_id, 'file');
-        $filedocument->url = file_create_url($file->uri);
-        $filedocument->path = file_stream_wrapper_get_instance_by_uri($file->uri)->getExternalUrl();
+          // Build our separate document and overwrite basic information
+          $filedocument->id = apachesolr_document_id($file->fid . '-' . $parent_entity_id, 'file');
+          $filedocument->url = file_create_url($file->uri);
+          $filedocument->path = file_stream_wrapper_get_instance_by_uri($file->uri)->getExternalUrl();
 
-        // Add extra info to our document
-        $filedocument->label = apachesolr_clean_text($file->filename);
-        $filedocument->content = apachesolr_clean_text($file->filename) . ' ' . $text;
+          // Add extra info to our document
+          $filedocument->label = apachesolr_clean_text($file->filename);
+          $filedocument->content = apachesolr_clean_text($file->filename) . ' ' . $text;
 
-        $filedocument->ds_created = apachesolr_date_iso($file->timestamp);
-        $filedocument->ds_changed = $filedocument->ds_created;
+          $filedocument->ds_created = apachesolr_date_iso($file->timestamp);
+          $filedocument->ds_changed = $filedocument->ds_created;
 
-        $filedocument->created = apachesolr_date_iso($file->timestamp);
-        $filedocument->changed = $filedocument->created;
+          $filedocument->created = apachesolr_date_iso($file->timestamp);
+          $filedocument->changed = $filedocument->created;
 
-        // Add Apachesolr Attachments specific fields.
-        $filedocument->is_parent_entity_id = $parent_entity_id;
-        $filedocument->ss_filemime = $file->filemime;
-        $filedocument->ss_filesize = $file->filesize;
+          // Add Apachesolr Attachments specific fields.
+          $filedocument->is_parent_entity_id = $parent_entity_id;
+          $filedocument->ss_filemime = $file->filemime;
+          $filedocument->ss_filesize = $file->filesize;
 
-        // Generate the path to the node
-        $filedocument->ss_file_entity_title = apachesolr_clean_text($parent_entity->title);
-        $parent_entity_uri = entity_uri($parent_entity_type, $parent_entity);
-        $parent_entity_uri['options']['absolute'] = TRUE;
-        $filedocument->ss_file_entity_url = url($parent_entity_uri['path'], $parent_entity_uri['options']);
-        $documents[] = $filedocument;
+          // Generate the path to the node
+          $filedocument->ss_file_entity_title = apachesolr_clean_text($parent_entity->title);
+          $parent_entity_uri = entity_uri($parent_entity_type, $parent_entity);
+          $parent_entity_uri['options']['absolute'] = TRUE;
+          $filedocument->ss_file_entity_url = url($parent_entity_uri['path'], $parent_entity_uri['options']);
+          $documents[] = $filedocument;
+        }
       }
     }
   }
   return $documents;
 }
 
+function apachesolr_attachments_node_solr_document(ApacheSolrDocument &$document, $parent_entity, $env_id) {
+  module_load_include('inc', 'apachesolr_attachments', 'apachesolr_attachments.index');
+
+  list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids('node', $parent_entity);
+
+  // proceed with combining attachment content to entity document only if the parent entity is flagged for
+  //indexing attachments with parent entity
+  if (variable_get('apachesolr_attachments_entity_bundle_indexing_' . $parent_entity_bundle, 'seperate') == 'parent') {
+
+
+    $file_field_names = array();
+    $fields = field_info_field_by_ids();
+    foreach ($fields as $field_id => $field_info) {
+      if ($field_info['type'] == 'file') {
+        foreach ($field_info['bundles'] as $entity_type => $bundles) {
+          if (in_array($parent_entity_bundle, $bundles)) {
+            $file_field_names[$field_info['field_name']] = $field_info['field_name'];
+          }
+        }
+        $file_field_names[] = $field_info['field_name'];
+      }
+    }
+
+    foreach ($file_field_names as $file_field) {
+      if (isset($parent_entity->$file_field)) {
+        $parent_entity_file_fields = $parent_entity->$file_field;
+        //@todo deal with different languages properly
+        foreach($parent_entity_file_fields as $language => $files) {
+          foreach ($files as $file) {
+
+            $file = (object)$file;
+            // perform some basic validation that the file is ok to extract text from
+            $status = ($file->status == 1 ? 1 : 0);
+            // Check if the mimetype is allowed
+            $status = $status & apachesolr_attachments_is_file($file);
+            $status = $status & apachesolr_attachments_allowed_mime($file->filemime);
+
+            if ($status) {
+              $text = apachesolr_attachments_get_attachment_text($file);
+              // append extracted text to index content field
+              $document->content .= $text;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  return array(); // all alterations are made to $document passed in by reference
+}
+
 /**
  * Reindexing callback for ApacheSolr, for file entities.
  */
@@ -353,6 +426,8 @@ function apachesolr_attachments_apachesolr_query_alter(DrupalSolrQueryInterface
 function apachesolr_attachments_entity_update($entity, $type) {
   module_load_include('inc', 'apachesolr_attachments', 'apachesolr_attachments.index');
   apachesolr_attachments_clean_index_table();
+
+  _apachesolr_attachments_update_parent_entity($entity, $type);
 }
 
 function apachesolr_attachments_entity_insert($entity, $type) {
@@ -362,6 +437,40 @@ function apachesolr_attachments_entity_insert($entity, $type) {
 function apachesolr_attachments_entity_delete($entity, $type) {
   module_load_include('inc', 'apachesolr_attachments', 'apachesolr_attachments.index');
   apachesolr_attachments_clean_index_table();
+
+  _apachesolr_attachments_update_parent_entity($entity, $type);
+}
+
+/**
+* trigger an apachesolr_entity_update of parents where the parents are flagged for indexing attachments with the parent
+**/
+function _apachesolr_attachments_update_parent_entity($entity, $type) {
+  // if this entity was being indexed with its parent, we need to trigger a reindex of the parent
+  $parents = file_get_file_references($entity, NULL, FIELD_LOAD_CURRENT);
+  $parents_list = $parents ? reset($parents) : NULL;
+
+  if (!empty($parents_list)) {
+    foreach ($parents_list as $parent_entity_type => $parent) {
+      foreach ($parent as $parent_entity_id => $parent_info) {
+        // load the parent entity and reset cache
+        $parent_entities = entity_load($parent_entity_type, array($parent_entity_id), NULL, TRUE);
+        // Take the first entity from the stack
+        $parent_entity = reset($parent_entities);
+
+        // Skip invalid entities
+        if (empty($parent_entity)) {
+          continue;
+        }
+
+        // get the bundle
+        list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids('node', $parent_entity);
+
+        if (variable_get('apachesolr_attachments_entity_bundle_indexing_' . $parent_entity_bundle, 'seperate') == 'parent') {
+          apachesolr_entity_update($parent_entity, $parent_entity_type);
+        }
+      }
+    }
+  }
 }
 
 /**
@@ -450,6 +559,7 @@ function apachesolr_attachments_theme() {
   );
 }
 
+
 function theme_apachesolr_search_snippets__file($vars) {
   $doc = $vars['doc'];
   $snippets = $vars['snippets'];
