Index: apachesolr_search.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Attic/apachesolr_search.admin.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 apachesolr_search.admin.inc
--- apachesolr_search.admin.inc	9 Dec 2008 01:01:29 -0000	1.1.2.1
+++ apachesolr_search.admin.inc	10 Dec 2008 14:52:58 -0000
@@ -10,13 +10,60 @@
  * Menu callback - the settings form.
  */
 function apachesolr_search_settings_page() {
-  return drupal_get_form('apachesolr_search_settings_form');
+  $output = drupal_get_form('apachesolr_search_bias_form');
+  // try to fetch the schema fields
+  try {
+    $solr = apachesolr_get_solr();
+    $fields = $solr->getFields();
+    $output .= drupal_get_form('apachesolr_search_settings_form', $fields);
+  }
+  catch (Exception $e) {
+    watchdog('apachesolr', $e->getMessage());
+    drupal_set_message($e->getMessage(), "warning");
+    $output .= t('Cannot get information about the fields in the index at this time.');
+  }
+
+  return $output;
+}
+
+/**
+ * Form builder function to set date bias.
+ */
+function apachesolr_search_bias_form($fields) {
+
+  $date_settings = variable_get('apacehsolr_search_date_boost', '4:3.0');
+  $comment_settings = variable_get('apacehsolr_search_comment_boost', '4:3.0');
+  
+  $options = array('0:0' => t('Omit'), '1:1.0' => t('Minimal'), '2:2.0' => t('Low'), '4:3.0' => t('Moderate'), '4:8.0' => t('High'), '10:13.0' => t('Higher'));
+    $form['biasing'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Result biasing'),
+      '#collapsible' => TRUE,
+      '#collapsed' => FALSE,
+      '#description' => t('Specify here biasing for different node properties when ordering the search results. Choose <em>Omit</em> to ignore this property.'),
+    );
+  $form['biasing']['apacehsolr_search_date_boost'] = array(
+    '#type' => 'select',
+    '#options' => $options,
+    '#title' => t("More recent change bias"),
+    '#default_value' => $date_settings,
+    '#description' => t('This setting will change the scoring so that more recent results may appear before those with higher keyword matching.'),
+  );
+  $form['biasing']['apacehsolr_search_comment_boost'] = array(
+    '#type' => 'select',
+    '#options' => $options,
+    '#title' => t("More comments bias"),
+    '#default_value' => $comment_settings,
+    '#description' => t('This setting will change the scoring so that nodes with more comments may appear before those with higher keyword matching.'),
+  );
+
+  return system_settings_form($form);
 }
 
 /**
  * Form builder function to set query field weights.
  */
-function apachesolr_search_settings_form() {
+function apachesolr_search_settings_form($fields) {
   $form = array();
 
   // get the current weights
@@ -27,7 +74,7 @@ function apachesolr_search_settings_form
   // Note - we have default values set in solrconfig.xml, which will operate when 
   // none are set.
   $defaults = array(
-    'body' => '0.5',
+    'body' => '1.0',
     'title' => '13.0',
     'name' => '5.0',
     'taxonomy_names' => '2.0',
@@ -40,9 +87,6 @@ function apachesolr_search_settings_form
   if (!$qf) {
     $qf = $defaults;
   }
-  // try to fetch the schema fields
-  $solr = apachesolr_get_solr();
-  $fields = $solr->getFields();
   if ($fields) {
 
     $form['apachesolr_search_query_fields'] = array(
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.42
diff -u -p -r1.1.2.6.2.42 apachesolr_search.module
--- apachesolr_search.module	9 Dec 2008 03:43:20 -0000	1.1.2.6.2.42
+++ apachesolr_search.module	10 Dec 2008 14:52:58 -0000
@@ -150,14 +150,24 @@ function apachesolr_search_search($op = 
         else {
           $total = db_result(db_query("SELECT COUNT(nid) FROM {node}"));
         }
-        $steepness = variable_get('apacehsolr_search_date_steepness', '4');
-        $date_boost = variable_get('apacehsolr_search_date_boost', '2.0');
+        $date_settings = variable_get('apacehsolr_search_date_boost', '4:3.0');
+        list($date_steepness, $date_boost) = explode(':', $date_settings);
         // Default date-biasing function, as suggested (but steeper) at
         // http://wiki.apache.org/solr/DisMaxRequestHandler
         // rord() returns 1 for the newset doc, and the number in the index for
-        // the oldest doc.  The function is thus: $total/(rord()*$steepness + $total).  
-        $params['bf'][] = "recip(rord(changed),$steepness,$total,$total)^$date_boost";
-
+        // the oldest doc.  The function is thus: $total/(rord()*$steepness + $total).
+        if ($date_boost) {
+          $params['bf'][] = "recip(rord(changed),$date_steepness,$total,$total)^$date_boost";
+        }
+        $comment_settings = variable_get('apacehsolr_search_comment_boost', '4:3.0');
+        list($comment_steepness, $comment_boost) = explode(':', $comment_settings);
+        // Default date-biasing function, as suggested (but steeper) at
+        // http://wiki.apache.org/solr/DisMaxRequestHandler
+        // rord() returns 1 for the newset doc, and the number in the index for
+        // the oldest doc.  The function is thus: $total/(rord()*$steepness + $total).
+        if ($comment_boost) {
+          $params['bf'][] = "recip(rord(comment_count),$comment_steepness,$total,$total)^$comment_boost";
+        }
         /**
          * This hook allows modules to modify the query are params objects.
          *
Index: solrconfig.xml
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Attic/solrconfig.xml,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 solrconfig.xml
--- solrconfig.xml	9 Dec 2008 03:43:20 -0000	1.1.2.3
+++ solrconfig.xml	10 Dec 2008 14:52:58 -0000
@@ -392,7 +392,7 @@
      <str name="echoParams">explicit</str>
      <float name="tie">0.01</float>
      <str name="qf">
-        body^0.5 title^13.0 name^5.0 taxonomy_names^2.0 tags_h1^21.0 tags_h2_h3^13.0 tags_h4_h5_h6^5.0 tags_inline^2.0 tags_a^2.0
+        body^1.0 title^13.0 name^5.0 taxonomy_names^2.0 tags_h1^21.0 tags_h2_h3^13.0 tags_h4_h5_h6^5.0 tags_inline^2.0 tags_a^2.0
      </str>
      <str name="pf">
         body^2.0 title^8.0
