diff -up updated/apachesolr.admin.inc apachesolr/apachesolr.admin.inc
--- updated/apachesolr.admin.inc	2009-10-30 12:49:37.000000000 -1000
+++ apachesolr/apachesolr.admin.inc	2009-09-17 07:14:06.000000000 -1000
@@ -76,6 +76,7 @@ function apachesolr_settings() {
     '#value' => l(t('Add a new content recommendation block'), 'admin/settings/apachesolr/mlt/add_block'),
     '#description' => format_plural(count(apachesolr_mlt_list_blocks()),  'You currently have 1 block.', 'You currenly have @count blocks.'),
   );
+
   $form['advanced'] = array(
     '#type' => 'fieldset',
     '#title' => t('Advanced configuration'),
@@ -306,6 +307,47 @@ function apachesolr_enabled_facets_form(
     '#value' => t('The Apache Solr filters settings were changed.  To arrange the blocks for your enabled filters, visit the <a href="@url">blocks administration page</a>.', array('@url' => url('admin/build/block'))),
   );
 
+  $form['restrictions'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Restrictions configuration'),
+    '#weight' => '1',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+
+  $_types = node_get_types('types');
+  $options = array();
+  foreach ($_types as $key => $type) {
+    $options[$key] = $type->name;
+  }
+  $_default = $block['mlt_res_types'];
+  if (!is_array($_default)) { $_default = array(); }
+
+  $form['restrictions']['mlt_res_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Content Types'),
+    '#default_value' => $_default,
+    '#options' => $options,
+    '#description' => t('Select the content types that More Like This results should be restricted to.'),
+    '#weight' => '-2',
+  );
+
+  $form['restrictions']['mlt_res_criteria'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Additional Criteria'),
+    '#description' => t('The additional criteria which all entries returned by this block must meet. Separate each criteria with a space. Ex. \'title:strategy\' will filter related content further to only those with strategy in the title.  Likewise \'HDTV^3\' will boost the term HDTV by a factor of 3'),
+    '#required' => FALSE,
+    '#default_value' => $block['mlt_res_criteria'],
+    '#weight' => '-1',
+  );
+
+  //field:[* TO 100]
+  //createdate:[1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]
+  //-inStock:false   -returns where 'inStock' is not false
+  //HDTV^3 -boost the term being searched for
+  //+title:strategies -title must contain strategies
+  //-title:strategies -title must NOT contain strategies
+
   return $form;
 }
 
@@ -539,6 +581,7 @@ function apachesolr_mlt_block_form($delt
     '#required' => TRUE,
     '#default_value' =>  $block['mlt_fl'],
   );
+
   $form['advanced'] = array(
     '#type' => 'fieldset',
     '#title' => t('Advanced configuration'),
@@ -583,6 +626,47 @@ function apachesolr_mlt_block_form($delt
     '#default_value' => $block['mlt_maxqt'],
   );
 
+  $form['restrictions'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Restrictions configuration'),
+    '#weight' => '1',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+
+  $_types = node_get_types('types');
+  $options = array();
+  foreach ($_types as $key => $type) {
+    $options[$key] = $type->name;
+  }
+  $_default = $block['mlt_res_types'];
+  if (!is_array($_default)) { $_default = array(); }
+
+  $form['restrictions']['mlt_res_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Content Types'),
+    '#default_value' => $_default,
+    '#options' => $options,
+    '#description' => t('Select the content types that More Like This results should be restricted to.'),
+    '#weight' => '-2',
+  );
+
+  $form['restrictions']['mlt_res_criteria'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Additional Criteria'),
+    '#description' => t('The additional criteria which all entries returned by this block must meet. Separate each criteria with a space. Ex. \'title:strategy\' will filter related content further to only those with strategy in the title.  Likewise \'HDTV^3\' will boost the term HDTV by a factor of 3'),
+    '#required' => FALSE,
+    '#default_value' => $block['mlt_res_criteria'],
+    '#weight' => '-1',
+  );
+
+  //field:[* TO 100]
+  //createdate:[1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]
+  //-inStock:false   -returns where 'inStock' is not false
+  //HDTV^3 -boost the term being searched for
+  //+title:strategies -title must contain strategies
+  //-title:strategies -title must NOT contain strategies
+
   return $form;
 }
 
@@ -602,6 +686,8 @@ function apachesolr_mlt_block_defaults($
     'mlt_minwl' => '3',
     'mlt_maxwl' => '15',
     'mlt_maxqt' => '20',
+    'mlt_res_criteria' => '',
+    'mlt_res_types' => '',
   );
 }
 
@@ -762,4 +848,4 @@ function apachesolr_batch_reindex_finish
     $message = t('An error occurred while processing @num with arguments :', array('@num' => $error_operation[0])) . print_r($error_operation[0], TRUE);
   }
   drupal_set_message($message, 'error');
-}
\ No newline at end of file
+}
Only in updated/: apachesolr.admin.inc.orig
Only in updated/: apachesolr.admin.inc.rej
diff -up updated/apachesolr.module apachesolr/apachesolr.module
--- updated/apachesolr.module	2009-10-30 12:48:43.000000000 -1000
+++ apachesolr/apachesolr.module	2009-10-25 16:12:32.000000000 -1000
@@ -210,7 +210,7 @@ function apachesolr_comment($edit, $op) 
     case 'delete':
     case 'publish':
     case 'unpublish':
-      // TODO: do we want to skip this if we are excluding comments 
+      // TODO: do we want to skip this if we are excluding comments
       // from the index for this node type?
       apachesolr_mark_node($edit['nid']);
       break;
@@ -1666,6 +1666,48 @@ function apachesolr_mlt_suggestions($set
     }
     $query = apachesolr_drupal_query('id:' . $id);
 
+    //if types available via array
+    if (is_array($settings['mlt_res_types'])) {
+      $_apply_sub = FALSE; //by default we will not apply the subquery
+      $sub_query = apachesolr_drupal_query();
+      //loop over content type restrictions
+      foreach ($settings['mlt_res_types'] as $type => $enabled) {
+
+        //if at least one content type was selected, then we'll limit results based on them
+        if ($enabled) {
+          $_apply_sub = TRUE;
+          $sub_query->add_filter('type', $type);
+        }
+
+        //if we're restricting the results
+        if ($_apply_sub) {
+          $query->add_subquery($sub_query);
+        }
+      }//end - loop
+    }//end - is array
+
+    //if there was an additional criteria specified
+    if (trim($settings['mlt_res_criteria']) !== "") {
+      $_criterias = explode(' ', trim($settings['mlt_res_criteria']));
+
+      $sub_query = apachesolr_drupal_query();
+
+      foreach ($_criterias as $idx => $_criteria) {
+        if ($_str_pos = strpos($_criteria, ':')) {
+          list($field, $value) = explode(':', $criteria);
+          $sub_query->add_filter($field, $value); // The TRUE makes it a negative filter.
+        } elseif ($_str_pos = strpos($_criteria, '^')) {
+          $params['bq'][] = $_criteria;
+        } else {
+          $sub_query->add_filter('title', $_criteria); // The TRUE makes it a negative filter.
+          $sub_query->add_filter('body', $_criteria); // The TRUE makes it a negative filter.
+        }
+      }
+
+      $query->add_subquery($sub_query);
+    }//end - if
+
+
     // This hook allows modules to modify the query and params objects.
     apachesolr_modify_query($query, $params, 'apachesolr_mlt');
     if (empty($query)) {
Common subdirectories: apachesolr/contrib and updated/contrib
Common subdirectories: apachesolr/drush and updated/drush
Common subdirectories: apachesolr/tests and updated/tests
