diff -urp apachesolr_old/apachesolr.module apachesolr/apachesolr.module
--- apachesolr_old/apachesolr.module	2008-10-18 17:14:37.000000000 +0300
+++ apachesolr/apachesolr.module	2008-10-18 15:56:53.000000000 +0300
@@ -37,6 +37,15 @@ function apachesolr_menu($may_cache) {
       'access'              => user_access('administer search'),
       'type'                => MENU_LOCAL_TASK,
     );
+    $items[] = array(
+      'path'                => 'admin/settings/apachesolr/dismax',
+      'title'               => t('Dismax configuration'),
+      'weight'              => -6,
+      'callback'            => 'drupal_get_form',
+      'callback arguments'  => 'apachesolr_settings_dismax',
+      'access'              => user_access('administer search'),
+      'type'                => MENU_LOCAL_TASK,
+    );
   }
   return $items;
 }
@@ -113,9 +122,120 @@ function apachesolr_settings() {
     '#default_value' => variable_get('apachesolr_failure', 'show_error'),
     '#description' => t('What to display if ApacheSolr search is not available.'),
   );
+  $form['apachesolr_reqhandler'] = array(
+    '#type' => 'select',
+    '#title' => t('Request handler'),
+    '#default_value' => variable_get('apachesolr_reqhandler', 'standard'),
+    '#options' => array(
+      'standard' => t('Standard request handler'),
+      'dismax' => t('Dismax request handler'),
+    ),
+    '#description' => t('The request handler to use when searching.'),
+  );
   return system_settings_form($form);
 }
 
+function apachesolr_settings_dismax() {
+  $form = array();
+
+  // get the current weights
+  $qf = variable_get('apachesolr_dismax_query_fields', '');
+  $weights = array();
+  foreach (explode(' ', $qf) as $f) {
+    $f = explode('^', $f);
+    $weights[$f[0]] = $f[1];
+  }
+  // check if dismax is selected as the request handler
+  if (variable_get('apachesolr_reqhandler', 'standard') == 'standard' && !isset($_POST['op'])) {
+    drupal_set_message(t('For these settings to take effect you have to select the Dismax request handler on the Settings page.'));
+  }
+  
+  // try to fetch the schema fields
+  $response = drupal_http_request(apachesolr_base_url() ."/admin/luke?numTerms=0");
+  if ($response->code == '200') {
+    $xml_response = simplexml_load_string($response->data);
+    $fields = $xml_response->xpath("//lst[@name='fields']/lst");
+    
+    $form['apachesolr_dismax_fields'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Field weights'),
+      '#collapsible' => TRUE,
+      '#collapsed' => FALSE,
+      '#description' => t('Specify here which fields are more important when searching. Give a field a bigger numeric value to make it more important.'),
+    );
+
+    foreach ((array)$fields as $field) {
+      $field_name = (string)$field['name'];
+      $form['apachesolr_dismax_fields']['field_'.$field_name] = array(
+        '#type' => 'textfield',
+        '#title' => $field_name,
+        '#default_value' => $weights[$field_name],
+        '#description' => t('Weight for field !field_name.', array('!field_name' => $field_name)),
+      );
+    }
+  }
+  else {
+    $form['apachesolr_dismax_query_fields'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Field weights'),
+      '#default_value' => $qf, 
+      '#description' => t('Specify here which fields are more important when searching. Format is field1^weight1 field2^weight2'),
+    );
+  }
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save settings'),
+  );  
+  
+  return $form;
+}
+
+function apachesolr_settings_dismax_validate($form_id, $form_values) {
+  if (isset($form_values['apachesolr_dismax_query_fields'])) {
+    $qf = trim($form_values['apachesolr_dismax_query_fields']);
+    $valid = true;
+    foreach (explode(' ', $qf) as $f) {
+      $f = explode('^', $f);
+      if (!is_numeric($f[1])) {
+        $valid = false;
+      }
+    }
+    
+    if (!$valid) {
+      form_set_error('apachesolr_dismax_query_fields', t('The boost query is not valid.'));
+    }
+  }
+  else {
+    foreach ($form_values as $key=>$value) {
+      if (strpos($key, 'field_') === 0 && $value != '') {
+        if (!is_numeric($value)) {
+          form_set_error($key, t('You must supply a numeric value.'));
+        }
+      }
+    }
+  }
+}
+
+function apachesolr_settings_dismax_submit($form_id, $form_values) {
+  if (isset($form_values['apachesolr_dismax_query_fields'])) {
+    variable_set('apachesolr_dismax_query_fields', trim($form_values['apachesolr_dismax_query_fields']));
+  }
+  else {
+    $qf = array();
+    foreach ($form_values as $key=>$value) {
+      if (strpos($key, 'field_') === 0) {
+        $field_name = str_replace('field_', '', $key);
+        if ($value) {
+          $qf[] = $field_name.'^'.$value;
+        }
+      }
+    }
+    $qf = implode(' ', $qf);
+    variable_set('apachesolr_dismax_query_fields', $qf);
+  }
+}
+
 /**
  * Determines ApacheSolr's behavior when searching causes an exception (e.g. Solr isn't available.)
  * Depending on the admin settings, possibly redirect to Drupal's core search.
diff -urp apachesolr_old/apachesolr_search.module apachesolr/apachesolr_search.module
--- apachesolr_old/apachesolr_search.module	2008-10-18 17:14:37.000000000 +0300
+++ apachesolr/apachesolr_search.module	2008-10-18 15:57:46.000000000 +0300
@@ -54,6 +54,15 @@ function apachesolr_search_search($op = 
           'facet.sort' => 'true'
         );
         
+        $req = variable_get('apachesolr_reqhandler', 'standard');
+        if ($req == 'dismax') {
+          $params['qt'] = 'dismax';
+          $qf = variable_get('apachesolr_dismax_query_fields', '');
+          if ($qf) {
+            $params['qf'] = $qf;
+          }
+        }
+        
         foreach (apachesolr_block() as $name => $values) {
           // TODO: Instead of getting this list from apachesolr_block, there
           // should instead be an API function that gets the list FOR apachesolr_block
