diff --git a/apachesolr_attachments.admin.inc b/apachesolr_attachments.admin.inc
index aa408b0..8f0095a 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 180d274..7c6bb69 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..15a3b30 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 7824904..6f5a4f9 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';
 }
 
 /**
@@ -100,61 +116,115 @@ function apachesolr_attachments_solr_document(ApacheSolrDocument $document, $fil
         // Retrieve the parent entity id and bundle
         list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids($parent_entity_type, $parent_entity);
 
-        // Get a clone of the bare minimum document
-        $filedocument = clone $document;
+        // 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);
+	
+	        // 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;
+	
+	        $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;
+	
+	        // Add Parent information fields. See http://drupal.org/node/1515822 for explanation
+	        $parent_entity_info = entity_get_info($parent_entity_type);
+	        $small_parent_entity = new stdClass();
+	        $small_parent_entity->entity_type = $parent_entity_type;
+	        $small_parent_entity->{$parent_entity_info['entity keys']['id']} = $parent_entity_id;
+	        $small_parent_entity->{$parent_entity_info['entity keys']['bundle']} = $parent_entity_bundle;
+	        $small_parent_entity->{$parent_entity_info['entity keys']['label']} = $parent_entity->{$parent_entity_info['entity keys']['label']};
+	
+	        // Add all to one field because if it is spread out over
+	        // multiple fields there is no way of knowing which multifield value
+	        // belongs to which entity
+	        // It does not load the complete entity in to the index because that
+	        // would dramatically increase the index size and processing time
+	        $filedocument->zm_parent_entity = serialize($small_parent_entity);
+	        $filedocument->sm_parent_entity_bundle = $parent_entity_type . "-" . $parent_entity_bundle;
+	        $filedocument->sm_parent_entity_type = $parent_entity_type;
+	
+	        // Add Apachesolr Attachments specific fields.
+	        $filedocument->ss_filemime = $file->filemime;
+	        $filedocument->ss_filesize = $file->filesize;
+	
+	        $documents[] = $filedocument;
+	      }
+      }
+    }
+  }
+  return $documents;
+}
 
-        //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));
+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'];
+          }
         }
+      }
+    }
 
-        // 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();
-
-        // 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->created = apachesolr_date_iso($file->timestamp);
-        $filedocument->changed = $filedocument->created;
-
-        // Add Parent information fields. See http://drupal.org/node/1515822 for explanation
-        $parent_entity_info = entity_get_info($parent_entity_type);
-        $small_parent_entity = new stdClass();
-        $small_parent_entity->entity_type = $parent_entity_type;
-        $small_parent_entity->{$parent_entity_info['entity keys']['id']} = $parent_entity_id;
-        $small_parent_entity->{$parent_entity_info['entity keys']['bundle']} = $parent_entity_bundle;
-        $small_parent_entity->{$parent_entity_info['entity keys']['label']} = $parent_entity->{$parent_entity_info['entity keys']['label']};
-
-        // Add all to one field because if it is spread out over
-        // multiple fields there is no way of knowing which multifield value
-        // belongs to which entity
-        // It does not load the complete entity in to the index because that
-        // would dramatically increase the index size and processing time
-        $filedocument->zm_parent_entity = serialize($small_parent_entity);
-        $filedocument->sm_parent_entity_bundle = $parent_entity_type . "-" . $parent_entity_bundle;
-        $filedocument->sm_parent_entity_type = $parent_entity_type;
-
-        // Add Apachesolr Attachments specific fields.
-        $filedocument->ss_filemime = $file->filemime;
-        $filedocument->ss_filesize = $file->filesize;
-
-        $documents[] = $filedocument;
+    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 $documents;
+
+  return array(); // all alterations are made to $document passed in by reference
 }
 
 /**
@@ -373,10 +443,14 @@ 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) {
   apachesolr_attachments_entity_update($entity, $type);
+  
+  _apachesolr_attachments_update_parent_entity($entity, $type);
 }
 
 function apachesolr_attachments_entity_delete($entity, $type) {
@@ -385,6 +459,38 @@ function apachesolr_attachments_entity_delete($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);
+        }
+      }
+    }
+  }
+}
+
+/**
  * Hook into the field operations
  *   - we want to save the same data in a shadow copy table for easier indexing.
  *   - We do not delete the file / media entity when its usage count goes to 0
