diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..395a770
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+SolrPhpClient
+*.swp
diff --git a/Drupal_Apache_Solr_Service.php b/Drupal_Apache_Solr_Service.php
index 175a4fc..5db39d8 100644
--- a/Drupal_Apache_Solr_Service.php
+++ b/Drupal_Apache_Solr_Service.php
@@ -256,47 +256,6 @@ class Drupal_Apache_Solr_Service extends Apache_Solr_Service {
     }
   }
 
-  /**
-   * Central method for making a get operation against this Solr Server
-   *
-   * @see Apache_Solr_Service::_sendRawGet()
-   */
-  protected function _sendRawGet($url, $timeout = FALSE) {
-    list($data, $headers) = $this->_makeHttpRequest($url, 'GET', array(), '', $timeout);
-    $response = new Apache_Solr_Response($data, $headers, $this->_createDocuments, $this->_collapseSingleValueArrays);
-    $code = (int) $response->getHttpStatus();
-    if ($code != 200) {
-      $message = $response->getHttpStatusMessage();
-      if ($code >= 400 && $code != 403 && $code != 404) {
-        // Add details, like Solr's exception message.
-        $message .= $response->getRawResponse();
-      }
-      throw new Exception('"' . $code . '" Status: ' . $message);
-    }
-    return $response;
-  }
-
-  /**
-   * Central method for making a post operation against this Solr Server
-   *
-   * @see Apache_Solr_Service::_sendRawPost()
-   */
-  protected function _sendRawPost($url, $rawPost, $timeout = FALSE, $contentType = 'text/xml; charset=UTF-8') {
-    $request_headers = array('Content-Type' => $contentType);
-    list($data, $headers) = $this->_makeHttpRequest($url, 'POST', $request_headers, $rawPost, $timeout);
-    $response = new Apache_Solr_Response($data, $headers, $this->_createDocuments, $this->_collapseSingleValueArrays);
-    $code = (int) $response->getHttpStatus();
-    if ($code != 200) {
-      $message = $response->getHttpStatusMessage();
-      if ($code >= 400 && $code != 403 && $code != 404) {
-        // Add details, like Solr's exception message.
-        $message .= $response->getRawResponse();
-      }
-      throw new Exception('"' . $code . '" Status: ' . $message);
-    }
-    return $response;
-  }
-
   protected function _makeHttpRequest($url, $method = 'GET', $headers = array(), $content = '', $timeout = FALSE) {
     // Set a response timeout
     if ($timeout) {
diff --git a/apachesolr.admin.inc b/apachesolr.admin.inc
index f617902..b36a131 100644
--- a/apachesolr.admin.inc
+++ b/apachesolr.admin.inc
@@ -84,7 +84,7 @@ function apachesolr_settings() {
   // Add a link to add more mlt blocks.
   $form['mlt_link'] = array(
     '#type' => 'item',
-    '#value' => l(t('Add a new content recommendation block'), 'admin/settings/apachesolr/mlt/add_block'),
+    '#markup' => l(t('Add a new content recommendation block'), 'admin/config/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(
@@ -164,10 +164,11 @@ function apachesolr_index_page() {
   $output .= '<p>' . l(t('View more details on the search index contents'), 'admin/reports/apachesolr') . "</p>\n";
   if (variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_WRITE) {
     // Display the Index Action form.
-    $output .= drupal_get_form('apachesolr_index_action_form');
+    // XXX: bit of a hack
+    $output .= drupal_render(drupal_get_form('apachesolr_index_action_form'));
   }
   else {
-    drupal_set_message(t('The index is in read-only mode. Options for deleting and re-indexing are therefore not available. The index mode can be changed on the !settings_page', array('!settings_page' => l(t('settings page'), 'admin/settings/apachesolr'))), 'warning');
+    drupal_set_message(t('The index is in read-only mode. Options for deleting and re-indexing are therefore not available. The index mode can be changed on the !settings_page', array('!settings_page' => l(t('settings page'), 'admin/config/apachesolr'))), 'warning');
   }
 
   return $output;
@@ -281,16 +282,14 @@ function apachesolr_enabled_facets_form() {
   }
 
   $enabled_facets = apachesolr_get_enabled_facets();
-  $form = array();
   $form['apachesolr_enabled_facets']['help'] = array(
     '#type' => 'item',
-    '#value' => t('You can use this screen to select which search filter blocks should be created by enabling the corresponding filters on this page. For performance reasons, you should only enable filters that you intend to have available to users on the search page.  After selecting which filter blocks to create, you will be sent to the blocks page where you can choose which of those blocks should be enabled when your users search by placing each block in a region.'),
+    '#markup' => t('You can use this screen to select which search filter blocks should be created by enabling the corresponding filters on this page. For performance reasons, you should only enable filters that you intend to have available to users on the search page.  After selecting which filter blocks to create, you will be sent to the blocks page where you can choose which of those blocks should be enabled when your users search by placing each block in a region.'),
   );
   if ($module_list) {
-    $placeholders = implode(', ', array_fill(0, count($module_list), "'%s'"));
-    $result = db_query("SELECT name, info FROM {system} WHERE name IN (". $placeholders .") AND type = 'module'", $module_list);
-    while ($item = db_fetch_array($result)) {
-      $module_list[$item['name']] = unserialize($item['info']);
+    $result = db_select('system')->fields('system', array('name', 'info'))->condition('name', $module_list, 'IN')->condition('type', 'module')->execute();
+    foreach ($result as $item) {
+      $module_list[$item->name] = unserialize($item->info);
     }
   }
   foreach ($module_facets as $module => $facets) {
@@ -322,14 +321,14 @@ function apachesolr_enabled_facets_form() {
     '#access' => $has_facets,
   );
   $form['no-facets-message'] = array(
-    '#value' => t('<em>No filters are available from your currently enabled modules</em>'),
+    '#markup' => t('<em>No filters are available from your currently enabled modules</em>'),
     '#access' => !$has_facets,
   );
 
   $form['#tree'] = TRUE;
   $form['submit_message'] = array(
     '#type' => 'value',
-    '#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'))),
+    '#markup' => 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'))),
   );
 
   return $form;
@@ -342,7 +341,8 @@ function apachesolr_index_action_form() {
   $form = array();
 
   $form['action'] = array(
-    '#value' => '<h3>'. t('Index Actions') .'</h3>',
+    '#type' => 'fieldset',
+    '#title' => t('Index Actions'),
   );
   // Jump through some forms hoops to get a description under each radio button.
   $actions = array(
@@ -369,7 +369,7 @@ function apachesolr_index_action_form() {
       '#return_value' => $key,
       '#parents' => array('action'),
       '#description' => $action['description'],
-      '#id' => form_clean_id('edit-'. implode('-', array('action', $key))),
+      '#id' => drupal_clean_css_identifier('edit-'. implode('-', array('action', $key))),
     );
   }
 
@@ -392,11 +392,11 @@ function apachesolr_index_action_form_submit($form, &$form_state) {
       break;
 
     case 'reindex':
-      $form_state['redirect'] = 'admin/settings/apachesolr/index/confirm/clear';
+      $form_state['redirect'] = 'admin/config/apachesolr/index/confirm/clear';
       break;
 
     case 'delete':
-      $form_state['redirect'] = 'admin/settings/apachesolr/index/confirm/delete';
+      $form_state['redirect'] = 'admin/config/apachesolr/index/confirm/delete';
       break;
   }
 }
@@ -407,7 +407,7 @@ function apachesolr_index_action_form_submit($form, &$form_state) {
  */
 function apachesolr_clear_index_confirm() {
   $form = array();
-  return confirm_form($form, t('Are you sure you want to queue content for reindexing?'), 'admin/settings/apachesolr/index', t('All content on the site will be queued for indexing. The documents currently in the Solr index will remain searchable. The content will be gradually resubmitted to Solr during cron runs.'), t('Reindex'), t('Cancel'));
+  return confirm_form($form, t('Are you sure you want to queue content for reindexing?'), 'admin/config/apachesolr/index', t('All content on the site will be queued for indexing. The documents currently in the Solr index will remain searchable. The content will be gradually resubmitted to Solr during cron runs.'), t('Reindex'), t('Cancel'));
 }
 
 /**
@@ -416,7 +416,7 @@ function apachesolr_clear_index_confirm() {
  * @see apachesolr_clear_index_confirm()
  */
 function apachesolr_clear_index_confirm_submit($form, &$form_state) {
-  $form_state['redirect'] = 'admin/settings/apachesolr/index';
+  $form_state['redirect'] = 'admin/config/apachesolr/index';
   apachesolr_rebuild_index_table();
   drupal_set_message(t('All the content on your site is queued for indexing. You can wait for it to be indexed during cron runs, or you can manually reindex it.'), 'warning');
 }
@@ -427,7 +427,7 @@ function apachesolr_clear_index_confirm_submit($form, &$form_state) {
  */
 function apachesolr_delete_index_confirm() {
   $form = array();
-  return confirm_form($form, t('Are you sure you want to delete the search index?'), 'admin/settings/apachesolr/index', t("All documents in the Solr index will be deleted. This is rarely necessary unless your index is corrupt or you have installed a new schema.xml. After doing this your content will need to be queued for indexing."), t('Delete'), t('Cancel'));
+  return confirm_form($form, t('Are you sure you want to delete the search index?'), 'admin/config/apachesolr/index', t("All documents in the Solr index will be deleted. This is rarely necessary unless your index is corrupt or you have installed a new schema.xml. After doing this your content will need to be queued for indexing."), t('Delete'), t('Cancel'));
 }
 
 /**
@@ -436,7 +436,7 @@ function apachesolr_delete_index_confirm() {
  * @see apachesolr_delete_index_confirm()
  */
 function apachesolr_delete_index_confirm_submit($form, &$form_state) {
-  $form_state['redirect'] = 'admin/settings/apachesolr/index';
+  $form_state['redirect'] = 'admin/config/apachesolr/index';
   try {
     apachesolr_delete_index();
     drupal_set_message(t('The Apache Solr content index has been erased. All the content on your site is queued for indexing. You can wait for it to be indexed during cron runs, or you can manually reindex it.'), 'warning');
@@ -593,7 +593,7 @@ function apachesolr_mlt_block_form($delta = NULL) {
   );
 
   $type_options = array();
-  foreach (node_get_types('types') as $key => $type) {
+  foreach (node_type_get_types() as $key => $type) {
     $type_options[$key] = $type->name;
   }
 
@@ -642,7 +642,7 @@ function apachesolr_mlt_block_defaults($block = array()) {
     'mlt_minwl' => '3',
     'mlt_maxwl' => '15',
     'mlt_maxqt' => '20',
-    'mlt_type_filters' => array_keys(node_get_types('types')),
+    'mlt_type_filters' => array_keys(node_type_get_types()),
     'mlt_custom_filters' => '',
   );
 }
diff --git a/apachesolr.index.inc b/apachesolr.index.inc
index b00ad33..513d230 100644
--- a/apachesolr.index.inc
+++ b/apachesolr.index.inc
@@ -32,8 +32,8 @@ function apachesolr_node_to_document($node, $namespace) {
 
   if ($build_document) {
     // Build the node body.
-    $node->build_mode = NODE_BUILD_SEARCH_INDEX;
-    $node = node_build_content($node, FALSE, FALSE);
+    $node->build_mode = 'search_index';
+    node_build_content($node);
     $node->body = drupal_render($node->content);
     $node->title = apachesolr_clean_text($node->title);
 
@@ -71,7 +71,8 @@ function apachesolr_node_to_document($node, $namespace) {
     $document->status = $node->status;
     $document->sticky = $node->sticky;
     $document->promote = $node->promote;
-    $document->moderate = $node->moderate;
+    // TODO: $node->moderate has been removed
+    //$document->moderate = $node->moderate;
     $document->tnid = $node->tnid;
     $document->translate = $node->translate;
     if (empty($node->language)) {
@@ -89,7 +90,7 @@ function apachesolr_node_to_document($node, $namespace) {
       $document->teaser = truncate_utf8($document->body, 300, TRUE);
     }
     $document->type = $node->type;
-    $document->type_name = node_get_types('name', $node);
+    $document->type_name = node_type_get_name($node);
     $document->created = apachesolr_date_iso($node->created);
     $document->changed = apachesolr_date_iso($node->changed);
     $last_change = (isset($node->last_comment_timestamp) && $node->last_comment_timestamp > $node->changed) ? $node->last_comment_timestamp : $node->changed;
@@ -241,7 +242,7 @@ function apachesolr_vocab_name($vid) {
   static $names = array();
 
   if (!isset($names[$vid])) {
-    $vocab_name = db_result(db_query('SELECT v.name FROM {vocabulary} v WHERE v.vid = %d', $vid));
+    $vocab_name = db_query('SELECT v.name FROM {vocabulary} v WHERE v.vid = :vid', array(':vid' => $vid))->fetchField();
     $names[$vid] = preg_replace('/[^a-zA-Z0-9_\x7f-\xff]/', '_', $vocab_name);
     // Fallback for names ending up all as '_'.
     $check = rtrim($names[$vid], '_');
@@ -300,7 +301,7 @@ function apachesolr_cron_check_node_table() {
   $nodes = array();
   // Update or delete at most this many in each Solr query.
   $limit = variable_get('apachesolr_cron_mass_limit', 500);
-  while ($node = db_fetch_object($result)) {
+  foreach ($result as $node) {
     $nodes[$node->nid] = $node;
     if (count($nodes) == $limit) {
       $node_lists[] = $nodes;
@@ -322,7 +323,7 @@ function apachesolr_cron_check_node_table() {
   $result = db_query("SELECT asn.nid FROM {apachesolr_search_node} asn LEFT JOIN {node} n ON n.nid = asn.nid WHERE n.nid IS NULL");
   $node_lists = array();
   $nodes = array();
-  while ($node = db_fetch_object($result)) {
+  foreach ($result as $node) {
     $nodes[$node->nid] = $node;
     if (count($nodes) == $limit) {
       $node_lists[] = $nodes;
@@ -364,10 +365,10 @@ function apachesolr_nodeapi_mass_update($nodes) {
 
       // There was no exception, so update the table.
     if ($published_ids) {
-      db_query("UPDATE {apachesolr_search_node} SET changed = %d, status = 1 WHERE nid IN (". db_placeholders($published_ids) .")", array_merge((array) $time, array_keys($published_ids)));
+      db_update('apachesolr_search_node')->fields(array('changed' => time(), 'status' => 1))->condition('nid', array_keys($published_ids), 'IN')->execute();
     }
     if ($unpublished_ids) {
-      db_query("UPDATE {apachesolr_search_node} SET changed = %d, status = 0 WHERE nid IN (". db_placeholders($unpublished_ids) .")", array_merge((array) $time, array_keys($unpublished_ids)));
+      db_update('apachesolr_search_node')->fields(array('changed' => time(), 'status' => 0))->condition('nid', array_keys($unpublished_ids), 'IN')->execute();
     }
     return TRUE;
   }
@@ -392,7 +393,7 @@ function apachesolr_nodeapi_mass_delete($nodes) {
     $solr->deleteByMultipleIds($ids);
     apachesolr_index_updated($time);
     // There was no exception, so update the table.
-    db_query("DELETE FROM {apachesolr_search_node} WHERE nid IN (" . db_placeholders($nids) . ")", $nids);
+    db_delete('apachesolr_search_node')->condition('nid', $nids, 'IN')->execute();
     return TRUE;
   }
   catch (Exception $e) {
diff --git a/apachesolr.info b/apachesolr.info
index 6231c29..282d208 100644
--- a/apachesolr.info
+++ b/apachesolr.info
@@ -3,14 +3,13 @@ name = Apache Solr framework
 description = Framework for searching with Solr
 dependencies[] = search
 package = Apache Solr
-core = "6.x"
-php = 5.1.4
-
-
-
-; Information added by drupal.org packaging script on 2010-05-04
-version = "6.x-2.x-dev"
-core = "6.x"
+core = "7.x"
+php = 5.2
+version = "7.x-1.x-dev"
 project = "apachesolr"
-datestamp = "1272931270"
 
+; Files
+files[] = apachesolr.admin.inc
+files[] = apachesolr.index.inc
+files[] = apachesolr.install
+files[] = apachesolr.taxonomy.inc 
diff --git a/apachesolr.install b/apachesolr.install
index e9ef02f..b1b6bbb 100644
--- a/apachesolr.install
+++ b/apachesolr.install
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_requirements().
+ * Implements hook_requirements().
  */
 function apachesolr_requirements($phase) {
   $requirements = array();
@@ -77,11 +77,9 @@ function apachesolr_requirements($phase) {
 }
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function apachesolr_install() {
-  // Create tables.
-  drupal_install_schema('apachesolr');
   // Create one MLT block.
   require_once(drupal_get_path('module', 'apachesolr') .'/apachesolr.admin.inc');
   apachesolr_mlt_save_block(array('name' => t('More like this')));
@@ -90,7 +88,7 @@ function apachesolr_install() {
 }
 
 /**
- * Implementation of hook_enable().
+ * Implements hook_enable().
  */
 function apachesolr_enable() {
   // Completely build the index table.
@@ -98,7 +96,7 @@ function apachesolr_enable() {
 }
 
 /**
- * Implementation of hook_schema().
+ * Implements hook_schema().
  *
  * TODO: move all node indexing/seach code to apachesolr_search
  */
@@ -135,7 +133,7 @@ function apachesolr_schema() {
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function apachesolr_uninstall() {
   variable_del('apachesolr_host');
@@ -149,8 +147,6 @@ function apachesolr_uninstall() {
   variable_del('apachesolr_mlt_blocks');
   variable_del('apachesolr_cron_limit');
   variable_del('apachesolr_enabled_facets');
-  // Remove tables.
-  drupal_uninstall_schema('apachesolr');
   // Remove blocks.
   db_query('DELETE FROM {blocks} WHERE module = "apachesolr"');
 }
diff --git a/apachesolr.module b/apachesolr.module
index f09cdeb..2a38c84 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -10,11 +10,11 @@ define('APACHESOLR_READ_WRITE', 0);
 define('APACHESOLR_READ_ONLY', 1);
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function apachesolr_menu() {
   $items = array();
-  $items['admin/settings/apachesolr'] = array(
+  $items['admin/config/apachesolr'] = array(
     'title'              => 'Apache Solr',
     'description'        => 'Administer Apache Solr.',
     'page callback'      => 'drupal_get_form',
@@ -22,15 +22,16 @@ function apachesolr_menu() {
     'access callback'    => 'user_access',
     'access arguments'   => array('administer search'),
     'file'               => 'apachesolr.admin.inc',
+    'type'               => MENU_NORMAL_ITEM,
   );
-  $items['admin/settings/apachesolr/settings'] = array(
+  $items['admin/config/apachesolr/settings'] = array(
     'title'              => 'Settings',
     'weight'             => -10,
     'access arguments'   => array('administer search'),
     'file'               => 'apachesolr.admin.inc',
-    'type'               => MENU_DEFAULT_LOCAL_TASK,
+    'type'               => MENU_LOCAL_TASK,
   );
-  $items['admin/settings/apachesolr/enabled-filters'] = array(
+  $items['admin/config/apachesolr/enabled-filters'] = array(
     'title'              => 'Enabled filters',
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('apachesolr_enabled_facets_form'),
@@ -39,7 +40,7 @@ function apachesolr_menu() {
     'file'               => 'apachesolr.admin.inc',
     'type'               => MENU_LOCAL_TASK,
   );
-  $items['admin/settings/apachesolr/index'] = array(
+  $items['admin/config/apachesolr/index'] = array(
     'title'              => 'Search index',
     'page callback'      => 'apachesolr_index_page',
     'access arguments'   => array('administer search'),
@@ -47,7 +48,7 @@ function apachesolr_menu() {
     'file'               => 'apachesolr.admin.inc',
     'type'               => MENU_LOCAL_TASK,
   );
-  $items['admin/settings/apachesolr/index/confirm/clear'] = array(
+  $items['admin/config/apachesolr/index/confirm/clear'] = array(
     'title'              => 'Confirm the re-indexing of all content',
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('apachesolr_clear_index_confirm'),
@@ -55,7 +56,7 @@ function apachesolr_menu() {
     'file'               => 'apachesolr.admin.inc',
     'type'               => MENU_CALLBACK,
   );
-  $items['admin/settings/apachesolr/index/confirm/delete'] = array(
+  $items['admin/config/apachesolr/index/confirm/delete'] = array(
     'title'              => 'Confirm index deletion',
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('apachesolr_delete_index_confirm'),
@@ -74,14 +75,14 @@ function apachesolr_menu() {
     'file'               => 'apachesolr.admin.inc',
     'type'               => MENU_DEFAULT_LOCAL_TASK,
   );
-  $items['admin/settings/apachesolr/mlt/add_block'] = array(
+  $items['admin/config/apachesolr/mlt/add_block'] = array(
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('apachesolr_mlt_add_block_form'),
     'access arguments'   => array('administer search'),
     'file'               => 'apachesolr.admin.inc',
     'type'               => MENU_CALLBACK,
   );
-  $items['admin/settings/apachesolr/mlt/delete_block/%'] = array(
+  $items['admin/config/apachesolr/mlt/delete_block/%'] = array(
     'page callback'      => 'drupal_get_form',
     'page arguments'     => array('apachesolr_mlt_delete_block_form', 5),
     'access arguments'   => array('administer search'),
@@ -146,7 +147,7 @@ function apachesolr_document_id($id, $entity = 'node') {
 }
 
 /**
- * Implementation of hook_user().
+ * Implements hook_user().
  *
  * Mark nodes as needing re-indexing if the author name changes.
  */
@@ -154,26 +155,28 @@ function apachesolr_user($op, &$edit, &$account) {
   switch ($op) {
     case 'update':
       if (isset($edit['name']) && $account->name != $edit['name']) {
-        db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {node} WHERE uid = %d)", time(), $account->uid);
+        $nids = db_select('node')->fields('node', array('nid'))->condition('uid', $account->uid);
+        db_update('apachesolr_search_node')->condition('nid', $nids, 'IN')->fields(array('changed'=>time()))->execute();
       }
       break;
   }
 }
 
 /**
- * Implementation of hook_taxonomy().
+ * Implements hook_taxonomy().
  *
  * Mark nodes as needing re-indexing if a term name changes.
  */
 function apachesolr_taxonomy($op, $type, $edit) {
   if ($type == 'term' && ($op == 'update')) {
-    db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {term_node} WHERE tid = %d)", time(), $edit['tid']);
+    $nids = db_select('term_node')->fields('term_node', array('nid'))->condition('tid', $edit['tid']);
+    db_update('apachesolr_search_node')->condition('nid', $nids, 'IN')->fields(array('changed'=>time()))->execute();
   }
   // TODO: the rest, such as term deletion.
 }
 
 /**
- * Implementation of hook_comment().
+ * Implements hook_comment().
  *
  * Mark nodes as needing re-indexing if comments are added or changed.
  * Like search_comment().
@@ -198,18 +201,19 @@ function apachesolr_comment($edit, $op) {
  * Mark one node as needing re-indexing.
  */
 function apachesolr_mark_node($nid) {
-  db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid = %d", time(), $nid);
+  db_update('apachesolr_search_node')->condition('nid', $nid)->fields(array('changed'=>time()))->execute();
 }
 
 /**
- * Implementation of hook_node_type().
+ * Implements hook_node_type().
  *
  * Mark nodes as needing re-indexing if a node type name changes.
  */
 function apachesolr_node_type($op, $info) {
   if ($op != 'delete' && !empty($info->old_type) && $info->old_type != $info->type) {
     // We cannot be sure we are going before or after node module.
-    db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {node} WHERE type = '%s' OR type = '%s')", time(), $info->old_type, $info->type);
+    $nid = db_select('node')->fields('node', array('nid'))->where("type = ':new' OR type = ':old'", array(':new'=>$info->type,':old'=>$info->old_type));
+    db_update('apachesolr_search_node')->condition('nid', $nid, 'IN')->fields(array('changed'=>time()))->execute();
   }
 }
 
@@ -218,13 +222,13 @@ function apachesolr_node_type($op, $info) {
  */
 function apachesolr_index_status($namespace) {
   list($excluded_types, $args, $join_sql, $exclude_sql) = apachesolr_exclude_types($namespace);
-  $total = db_result(db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn ". $join_sql ."WHERE asn.status = 1 " . $exclude_sql, $excluded_types));
-  $remaining = db_result(db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn ". $join_sql ."WHERE (asn.changed > %d OR (asn.changed = %d AND asn.nid > %d)) AND asn.status = 1 "  . $exclude_sql, $args));
+  $total = db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn ". $join_sql ."WHERE asn.status = 1 " . $exclude_sql)->fetchField();
+  $remaining = db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn ". $join_sql ."WHERE (asn.changed > :last_change OR (asn.changed = :last_change AND asn.nid > :last_nid)) AND asn.status = 1 "  . $exclude_sql, $args)->fetchField();
   return array('remaining' => $remaining, 'total' => $total);
 }
 
 /**
- * Returns last changed and last nid for an indexing namespace.
+ * Returns last_changed and last_nid for an indexing namespace.
  */
 function apachesolr_get_last_index($namespace) {
   $stored = variable_get('apachesolr_index_last', array());
@@ -255,22 +259,24 @@ function apachesolr_clear_last_index($namespace = '') {
  */
 function apachesolr_rebuild_index_table($type = NULL) {
   if (isset($type)) {
-    db_query("DELETE FROM {apachesolr_search_node} WHERE nid IN (SELECT nid FROM {node} WHERE type = '%s')", $type);
+    $nids = db_select('node')->fields('node', array('nid'))->condition('type', $type);
+    db_delete('apachesolr_search_node')->condition('nid', $nids, 'IN')->execute();
     // Populate table
+    // TODO: use db_insert()
     db_query("INSERT INTO {apachesolr_search_node} (nid, status, changed)
-              SELECT n.nid, n.status, %d AS changed
-              FROM {node} n WHERE n.type = '%s'", time(), $type);
+              SELECT n.nid, n.status, :time AS changed
+              FROM {node} n WHERE n.type = ':type'", array(':time'=>time(),':type'=>$type));
   }
   else {
-    db_query("DELETE FROM {apachesolr_search_node}");
+    db_delete('apachesolr_search_node')->execute();
     // Populate table
+    // TODO: use db_insert()
     db_query("INSERT INTO {apachesolr_search_node} (nid, status, changed)
               SELECT n.nid, n.status, GREATEST(n.created, n.changed, COALESCE(c.last_comment_timestamp, 0)) AS changed
               FROM {node} n
               LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid");
     // Make sure no nodes end up with a timestamp that's in the future.
-    $time = time();
-    db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE changed > %d", $time, $time);
+    db_update('apachesolr_search_node')->condition('changed', time(), '>')->fields(array('changed'=>time()))->execute();
     apachesolr_clear_last_index();
   }
   cache_clear_all('*', 'cache_apachesolr', TRUE);
@@ -279,14 +285,13 @@ function apachesolr_rebuild_index_table($type = NULL) {
 function apachesolr_exclude_types($namespace) {
   extract(apachesolr_get_last_index($namespace));
   $excluded_types = module_invoke_all('apachesolr_types_exclude', $namespace);
-  $args = array($last_change, $last_change, $last_nid);
+  $args = array(':last_change' => $last_change, ':last_nid' => $last_nid);
   $join_sql = '';
   $exclude_sql = '';
   if ($excluded_types) {
     $excluded_types = array_unique($excluded_types);
     $join_sql = "INNER JOIN {node} n ON n.nid = asn.nid ";
-    $exclude_sql = "AND n.type NOT IN(". db_placeholders($excluded_types, 'varchar') .") ";
-    $args = array_merge($args, $excluded_types);
+    $exclude_sql = "AND n.type NOT IN('" . implode("','", $excluded_types) . "') ";
   }
   return array($excluded_types, $args, $join_sql, $exclude_sql);
 }
@@ -300,11 +305,9 @@ function apachesolr_get_nodes_to_index($namespace, $limit) {
     return $rows;
   }
   list($excluded_types, $args, $join_sql, $exclude_sql) = apachesolr_exclude_types($namespace);
-  $result = db_query_range("SELECT asn.nid, asn.changed FROM {apachesolr_search_node} asn ". $join_sql ."WHERE (asn.changed > %d OR (asn.changed = %d AND asn.nid > %d)) AND asn.status = 1 ". $exclude_sql ."ORDER BY asn.changed ASC, asn.nid ASC", $args, 0, $limit);
-  while ($row = db_fetch_object($result)) {
-    $rows[] = $row;
-  }
-  return $rows;
+  // TODO: update to use new API
+  $result = db_query_range("SELECT asn.nid, asn.changed FROM {apachesolr_search_node} asn ". $join_sql ."WHERE (asn.changed > :last_change OR (asn.changed = :last_change AND asn.nid > :last_nid)) AND asn.status = 1 ". $exclude_sql ."ORDER BY asn.changed ASC, asn.nid ASC", 0, $limit, $args);
+  return $result;
 }
 
 /**
@@ -388,6 +391,8 @@ function apachesolr_index_nodes($rows, $namespace) {
       $docs_chunk = array_chunk($documents, 20);
       foreach ($docs_chunk as $docs) {
         $solr->addDocuments($docs);
+        // TODO: is this neccessary?
+        $solr->commit();
       }
       // Set the timestamp to indicate an index update.
       apachesolr_index_set_last_updated(time());
@@ -486,22 +491,30 @@ function apachesolr_index_get_last_updated() {
 }
 
 /**
- * Implementation of hook_cron().
+ * Implements hook_cron().
  */
 function apachesolr_cron() {
   try {
     $solr = apachesolr_get_solr();
 
     // Check for unpublished content that wasn't deleted from the index.
-    $result = db_query("SELECT n.nid, n.status FROM {apachesolr_search_node} asn INNER JOIN {node} n ON n.nid = asn.nid WHERE asn.status <> n.status");
-    while ($node = db_fetch_object($result)) {
-      apachesolr_nodeapi_update($node, FALSE);
+    $query = db_select('apachesolr_search_node', 'asn');
+    $na = $query->innerJoin('node', 'n', 'n.nid = asn.nid');
+    $query->fields($na, array('nid', 'status'));
+    $query->condition('asn.status', "$na.status", '<>');
+    $result = $query->execute();
+    foreach ($result as $node) {
+      apachesolr_node_update($node, FALSE);
     }
 
     // Check for deleted content that wasn't deleted from the index.
-    $result = db_query("SELECT asn.nid FROM {apachesolr_search_node} asn LEFT JOIN {node} n ON n.nid = asn.nid WHERE n.nid IS NULL");
-    while ($node = db_fetch_object($result)) {
-      apachesolr_nodeapi_delete($node, FALSE);
+    $query = db_select('apachesolr_search_node', 'asn');
+    $query->fields('asn', array('nid'));
+    $na = $query->leftJoin('node', 'n', 'n.nid = asn.nid');
+    $query->isNull("$na.nid");
+    $result = $query->execute();
+    foreach ($result as $node) {
+      apachesolr_node_delete($node, FALSE);
     }
 
     // Optimize the index (by default once a day).
@@ -534,7 +547,7 @@ function apachesolr_cron() {
 }
 
 /**
- * Implementation of hook_flush_caches().
+ * Implements hook_flush_caches().
  */
 function apachesolr_flush_caches() {
   return array('cache_apachesolr');
@@ -550,31 +563,20 @@ function apachesolr_clear_cache() {
 }
 
 /**
- * Implementation of hook_nodeapi().
+ * Implements hook_node_insert().
  */
-function apachesolr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
-  switch ($op) {
-    case 'delete':
-      apachesolr_nodeapi_delete($node);
-      break;
-    case 'insert':
-      // Make sure no node ends up with a timestamp that's in the future
-      // by using time() rather than the node's changed or created timestamp.
-      db_query("INSERT INTO {apachesolr_search_node} (nid, status, changed) VALUES (%d, %d, %d)", $node->nid, $node->status, time());
-      break;
-    case 'update':
-      apachesolr_nodeapi_update($node);
-      break;
-  }
+function apachesolr_node_insert($node) {
+  // Make sure no node ends up with a timestamp that's in the future by using time() rather than the node's changed or created timestamp.
+  db_insert('apachesolr_search_node')->fields(array('nid'=>$node->nid, 'status'=>$node->status, 'changed'=>time()))->execute();
 }
 
 /**
- * Helper function for hook_nodeapi().
+ * Implements hook_node_delete().
  */
-function apachesolr_nodeapi_delete($node, $set_message = TRUE) {
+function apachesolr_node_delete($node, $set_message = TRUE) {
   if (apachesolr_delete_node_from_index($node)) {
     // There was no exception, so delete from the table.
-    db_query("DELETE FROM {apachesolr_search_node} WHERE nid = %d", $node->nid);
+    db_delete('apachesolr_search_node')->condition('nid', $node->nid)->execute();
     if ($set_message && user_access('administer search') && variable_get('apachesolr_set_nodeapi_messages', 1)) {
       apachesolr_set_stats_message('Deleted content will be removed from the Apache Solr search index in approximately @autocommit_time.');
     }
@@ -582,21 +584,21 @@ function apachesolr_nodeapi_delete($node, $set_message = TRUE) {
 }
 
 /**
- * Helper function for hook_nodeapi().
+ * Implements hook_node_update().
  */
-function apachesolr_nodeapi_update($node, $set_message = TRUE) {
+function apachesolr_node_update($node, $set_message = TRUE) {
   // Check if the node has gone from published to unpublished.
-  if (!$node->status && db_result(db_query("SELECT status FROM {apachesolr_search_node} WHERE nid = %d", $node->nid))) {
+  if (!$node->status && db_select('apachesolr_search_node', 'asn')->fields('asn', array('status'))->condition('nid', $node->nid)->execute()) {
     if (apachesolr_delete_node_from_index($node)) {
       // There was no exception, so update the table.
-      db_query("UPDATE {apachesolr_search_node} SET changed = %d, status = %d WHERE nid = %d", time(), $node->status, $node->nid);
+      db_update('apachesolr_search_node')->condition('nid', $node->nid)->fields(array('changed'=>time(), 'status'=>$node->status))->execute();
       if ($set_message && user_access('administer search') && variable_get('apachesolr_set_nodeapi_messages', 1)) {
         apachesolr_set_stats_message('Unpublished content will be removed from the Apache Solr search index in approximately @autocommit_time.');
       }
     }
   }
   else {
-    db_query("UPDATE {apachesolr_search_node} SET changed = %d, status = %d WHERE nid = %d", time(), $node->status, $node->nid);
+    db_update('apachesolr_search_node')->condition('nid', $node->nid)->fields(array('changed'=>time(), 'status'=>$node->status))->execute();
   }
 }
 
@@ -670,7 +672,7 @@ function apachesolr_save_module_facets($module, $facets = array()) {
 }
 
 /**
- * Implementation of hook_block().
+ * Implements hook_block().
  */
 function apachesolr_block($op = 'list', $delta = 0, $edit = array()) {
   static $access;
@@ -853,7 +855,7 @@ function apachesolr_get_facet_definition_by_field_name($field_name) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * Make sure to flush cache when content types are changed.
  */
@@ -862,7 +864,7 @@ function apachesolr_form_node_type_form_alter(&$form, $form_state) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * Make sure to flush cache when fields are added.
  */
@@ -871,7 +873,7 @@ function apachesolr_form_content_field_overview_form_alter(&$form, $form_state)
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * Make sure to flush cache when fields are updated.
  */
@@ -880,7 +882,7 @@ function apachesolr_form_content_field_edit_form_alter(&$form, $form_state) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * Hide the core 'title' field in favor of our 'name' field.
  *
@@ -1801,8 +1803,9 @@ function apachesolr_cck_fields() {
       );
       // Allow other modules to add or alter mappings.
       drupal_alter('apachesolr_cck_fields', $mappings);
+      // TODO: use db_select
       $result = db_query("SELECT i.field_name, f.multiple, f.type AS field_type, i.widget_type, i.label, i.type_name AS content_type FROM {content_node_field_instance} i INNER JOIN {content_node_field} f ON i.field_name = f.field_name;");
-      while ($row = db_fetch_object($result)) {
+      foreach($result as $row) {
         // Only deal with fields that have option widgets (facets don't make sense otherwise), or fields that have specific mappings.
         if ((isset($mappings[$row->field_type][$row->widget_type]) ||  isset($mappings['per-field'][$row->field_name]))) {
           if (isset($mappings['per-field'][$row->field_name])) {
@@ -1840,7 +1843,7 @@ function apachesolr_cck_fields() {
 }
 
 /**
- * Implementation of hook_content_fieldapi().
+ * Implements hook_content_fieldapi().
  */
 function apachesolr_content_fieldapi($op) {
   if ($op == 'update instance') {
@@ -1903,7 +1906,7 @@ function apachesolr_cck_userreference_field_callback($facet, $options) {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function apachesolr_theme() {
   return array(
@@ -2015,7 +2018,7 @@ function apachesolr_mlt_suggestions($settings, $id) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter
+ * Implements hook_form_[form_id]_alter
  */
 function apachesolr_form_block_admin_display_form_alter(&$form) {
   foreach ($form as $key => $block) {
@@ -2165,7 +2168,7 @@ function theme_apachesolr_facet_list($items, $display_limit = 0, $delta = '') {
   }
   $admin_link = '';
   if (user_access('administer search')) {
-    $admin_link = l(t('Configure enabled filters'), 'admin/settings/apachesolr/enabled-filters');
+    $admin_link = l(t('Configure enabled filters'), 'admin/config/apachesolr/enabled-filters');
   }
   return theme('item_list', $items) . $admin_link;
 }
diff --git a/apachesolr_search.admin.inc b/apachesolr_search.admin.inc
index 29fd37b..5694987 100644
--- a/apachesolr_search.admin.inc
+++ b/apachesolr_search.admin.inc
@@ -10,17 +10,16 @@
  * Menu callback - the settings form.
  */
 function apachesolr_search_settings_page() {
-  $output = '';
   // Try to fetch the schema fields.
   try {
     $solr = apachesolr_get_solr();
     $fields = $solr->getFields();
-    $output .= drupal_get_form('apachesolr_search_settings_form', $fields);
+    $output = drupal_get_form('apachesolr_search_settings_form', $fields);
   }
   catch (Exception $e) {
     watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
-    drupal_set_message(nl2br(check_plain($e->getMessage())), "warning");
-    $output .= t('Cannot get information about the fields in the index at this time.');
+    drupal_set_message(nl2br(check_plain($e->getMessage())), 'warning');
+    $output = t('Cannot get information about the fields in the index at this time.');
   }
   return $output;
 }
@@ -30,14 +29,14 @@ function apachesolr_search_settings_page() {
  */
 function apachesolr_boost_settings_page() {
   $output = drupal_get_form('apachesolr_search_bias_form');
-  $output .= drupal_get_form('apachesolr_search_type_boost_form');
+  $output += drupal_get_form('apachesolr_search_type_boost_form');
   return $output;
 }
 
 /**
  * Form builder function to set date, comment, etc biases.
  */
-function apachesolr_search_bias_form($form_state) {
+function apachesolr_search_bias_form($form, &$form_state) {
 
   $date_settings = variable_get('apachesolr_search_date_boost', '4:200.0');
   $comment_settings = variable_get('apachesolr_search_comment_boost', '0:0');
@@ -105,17 +104,20 @@ function apachesolr_search_bias_form($form_state) {
     '#description' => t('This setting will change the result scoring so that nodes with the most recent comments (or most recent updates to the node itself) may appear before those with higher keyword matching.'),
   );
   $form = system_settings_form($form);
-  $form['biasing']['buttons'] = $form['buttons'];
-  unset($form['buttons']);
+
+  // TODO: is this neccessary?
+  if (isset($form['buttons'])) {
+    $form['biasing']['buttons'] = $form['buttons'];
+    unset($form['buttons']);
+  }
+
   return $form;
 }
 
 /**
  * Form builder function to set query field weights.
  */
-function apachesolr_search_settings_form($form_state, $fields) {
-  $form = array();
-
+function apachesolr_search_settings_form($form, &$form_state, $fields) {
   // get the current weights
   $qf = variable_get('apachesolr_search_query_fields', array());
   $weights = drupal_map_assoc(array('21.0', '13.0', '8.0', '5.0', '3.0', '2.0', '1.0', '0.8', '0.5', '0.3', '0.2', '0.1'));
@@ -178,9 +180,7 @@ function apachesolr_search_settings_form($form_state, $fields) {
 /**
  * Form builder function to set query type weights.
  */
-function apachesolr_search_type_boost_form($form_state) {
-  $form = array();
-
+function apachesolr_search_type_boost_form($form, &$form_state) {
   $form['apachesolr_search_type_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('Type biasing and exclusion'),
@@ -198,7 +198,7 @@ function apachesolr_search_type_boost_form($form_state) {
 
   // Get the current boost values.
   $type_boosts = variable_get('apachesolr_search_type_boosts', array());
-  $names = node_get_types('names');
+  $names = node_type_get_names();
 
   foreach ($names as $type => $name) {
     $form['apachesolr_search_type_settings']['apachesolr_search_type_boosts'][$type] = array(
@@ -219,8 +219,13 @@ function apachesolr_search_type_boost_form($form_state) {
 
   $form['#submit'][] = 'apachesolr_search_type_boost_form_submit';
   $form = system_settings_form($form);
-  $form['apachesolr_search_type_settings']['buttons'] = $form['buttons'];
-  unset($form['buttons']);
+
+  // TODO: is this neccessary?
+  if (isset($form['buttons'])) {
+    $form['apachesolr_search_type_settings']['buttons'] = $form['buttons'];
+    unset($form['buttons']);
+  }
+
   return $form;
 }
 
diff --git a/apachesolr_search.info b/apachesolr_search.info
index 87ea288..e536fe7 100644
--- a/apachesolr_search.info
+++ b/apachesolr_search.info
@@ -4,14 +4,12 @@ description = Search with Solr
 dependencies[] = search
 dependencies[] = apachesolr
 package = Apache Solr
-core = "6.x"
-php = 5.1.4
-
-
-
-; Information added by drupal.org packaging script on 2010-05-04
-version = "6.x-2.x-dev"
-core = "6.x"
+core = "7.x"
+php = 5.2
+version = "7.x-1.x-dev"
 project = "apachesolr"
-datestamp = "1272931270"
 
+; Files
+files[] = apachesolr_search.info
+files[] = apachesolr_search.install
+files[] = apachesolr_search.module
diff --git a/apachesolr_search.install b/apachesolr_search.install
index 1a07ffb..bd0c1c1 100644
--- a/apachesolr_search.install
+++ b/apachesolr_search.install
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  * Update to namespace tracking.
  */
 function apachesolr_search_uninstall() {
diff --git a/apachesolr_search.module b/apachesolr_search.module
index 8e1da4c..427b34b 100644
--- a/apachesolr_search.module
+++ b/apachesolr_search.module
@@ -8,11 +8,21 @@
  */
 
 /**
- * Implementation of hook_help().
+ * Implements hook_search_info().
+ */
+function apachesolr_search_search_info() {
+  return array(
+    'title' => 'Apache Solr',
+    'path' => 'apachesolr_search',
+  );
+}
+
+/**
+ * Implements hook_help().
  */
 function apachesolr_search_help($section) {
   switch ($section) {
-    case 'admin/settings/apachesolr/index':
+    case 'admin/config/apachesolr/index':
       if (variable_get('apachesolr_read_only', 0)) {
         return t('Operating in read-only mode; updates are disabled.');
       }
@@ -24,7 +34,7 @@ function apachesolr_search_help($section) {
       $total += $status['total'];
 
       return t('The search index is generated by !cron. %percentage of the site content has been sent to the server. There @items left to send.', array(
-        '!cron' => l(t('running cron'), 'admin/reports/status/run-cron', array('query' => array('destination' => 'admin/settings/apachesolr/index'))),
+        '!cron' => l(t('running cron'), 'admin/reports/status/run-cron', array('query' => array('destination' => 'admin/config/apachesolr/index'))),
         '%percentage' => ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) .'%',
         '@items' => format_plural($remaining, t('is 1 item'), t('are @count items')
       )));
@@ -32,10 +42,10 @@ function apachesolr_search_help($section) {
 }
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function apachesolr_search_menu() {
-  $items['admin/settings/apachesolr/query-fields'] = array(
+  $items['admin/config/apachesolr/query-fields'] = array(
     'title'            => 'Search fields',
     'page callback'    => 'apachesolr_search_settings_page',
     'access arguments' => array('administer search'),
@@ -43,7 +53,7 @@ function apachesolr_search_menu() {
     'type'             => MENU_LOCAL_TASK,
     'file'             => 'apachesolr_search.admin.inc',
   );
-  $items['admin/settings/apachesolr/content-bias'] = array(
+  $items['admin/config/apachesolr/content-bias'] = array(
     'title'            => 'Content bias settings',
     'page callback'    => 'apachesolr_boost_settings_page',
     'access arguments' => array('administer search'),
@@ -56,11 +66,12 @@ function apachesolr_search_menu() {
 }
 
  /**
- * Implementation of hook_menu_alter().
+ * Implements hook_menu_alter().
  */
 function apachesolr_search_menu_alter(&$menu) {
   if (isset($menu['search/apachesolr_search/%menu_tail'])) {
     $menu['search']['page callback'] = 'apachesolr_search_view';
+    $menu['search/apachesolr_search']['page callback'] = 'apachesolr_search_view';
     $menu['search/apachesolr_search/%menu_tail']['page callback'] = 'apachesolr_search_view';
   }
   if (variable_get('apachesolr_search_make_default', 0)) {
@@ -84,10 +95,11 @@ function apachesolr_search_menu_alter(&$menu) {
       $menu['taxonomy/term/%']['file'] = 'apachesolr.taxonomy.inc';
     }
   }
+watchdog('evolvingweb', print_r($menu, TRUE));
 }
 
 /**
- * Implementation of hook_cron(). Indexes nodes.
+ * Implements hook_cron(). Indexes nodes.
  */
 function apachesolr_search_cron() {
   $cron_limit = variable_get('apachesolr_cron_limit', 50);
@@ -96,7 +108,7 @@ function apachesolr_search_cron() {
 }
 
 /**
- * Implementation of hook_apachesolr_types_exclude().
+ * Implements hook_apachesolr_types_exclude().
  */
 function apachesolr_search_apachesolr_types_exclude($namespace) {
   if ($namespace == 'apachesolr_search') {
@@ -106,7 +118,7 @@ function apachesolr_search_apachesolr_types_exclude($namespace) {
 }
 
 /**
- * Implementation of hook_search().
+ * Implements hook_search().
  */
 function apachesolr_search_search($op = 'search', $keys = NULL) {
 
@@ -143,6 +155,7 @@ function apachesolr_search_search($op = 'search', $keys = NULL) {
 function apachesolr_search_view($type = NULL) {
   $keys = trim(search_get_keys());
   $content = '';
+  $build = array();
   // Search form submits with POST but redirects to GET.
   if (!isset($_POST['keys'])) {
     if (empty($type)) {
@@ -173,16 +186,18 @@ function apachesolr_search_view($type = NULL) {
           return module_invoke($type, 'search_page', $content);
         }
         else {
-          return drupal_get_form('search_form', NULL, $keys, $type) . theme('search_results', $content, $type);
+          $build['form'] = drupal_get_form('search_form', NULL, $keys, $type);
+          $build['content'] = theme('search_results', array('results' => $content, 'type' => $type));
+          return $build;
         }
       }
 
       // See search_view().
       if ($content) {
-        $content = theme('box', t('Search results'), $content);
+        $content = '<h2 class="title">' . t('Search results') . '</h2><div>' . $content . '</div>';
       }
       else {
-        $content = theme('box', t('Your search yielded no results'), variable_get('apachesolr_search_noresults', apachesolr_search_noresults()));
+        $content = '<h2 class="title">' . t('Your search yielded no results') . '</h2><div>' . variable_get('apachesolr_search_noresults', apachesolr_search_noresults()) . '</div>';
       }
     }
     elseif ($type != 'node') {
@@ -207,7 +222,9 @@ function apachesolr_search_view($type = NULL) {
     }
   }
   // Construct the search form.
-  return drupal_get_form('search_form', NULL, $keys, $type) . $content;
+  $build['form'] = drupal_get_form('search_form', NULL, $keys, $type);
+  $build['content'] = array('#markup' => $content);
+  return $build;
 }
 
 function apachesolr_search_noresults() {
@@ -220,7 +237,7 @@ function apachesolr_search_noresults() {
 
 
 /**
- * Implementation of hook_apachesolr_document_handlers().
+ * Implements hook_apachesolr_document_handlers().
  *
  * @param string $type
  *   Entity type. 'node', 'comment', and so forth. Used to evaluate whether this module
@@ -277,10 +294,10 @@ function apachesolr_search_browse($keys = '', $filters = '', $solrsort = '', $ba
       if (count((array) $response->facet_counts->facet_fields->$facet_field) > 0 ||
           count((array) $response->facet_counts->facet_dates->$facet_field) > 0) {
         // This bit is modeled on block.module, block_list().
-        $result = db_query_range(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b
+        $result = db_query_range("SELECT DISTINCT b.* FROM {blocks} b
           LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta
           WHERE b.module = '%s' AND b.delta = '%s' AND b.theme = '%s' AND b.status = 1
-            AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL)", 'b', 'bid'), array_merge(array($module, $delta, $theme_key), $rids), 0, 1);
+            AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL)", array_merge(array($module, $delta, $theme_key), $rids), 0, 1);
         $block = db_fetch_object($result);
         $hook_block = (object)module_invoke($module, 'block', 'view', $delta);
         $block->content = $hook_block->content;
@@ -481,7 +498,7 @@ function apachesolr_search_add_boost_params(&$params, $query, $solr) {
     $total = $data->index->numDocs;
   }
   else {
-    $total = db_result(db_query("SELECT COUNT(nid) FROM {node}"));
+    $total = db_query("SELECT COUNT(nid) FROM {node}")->fetchField();
   }
   // For the boost functions for the created timestamp, etc we use the
   // standard date-biasing function, as suggested (but steeper) at
@@ -539,10 +556,10 @@ function apachesolr_search_process_response($response, $query, $params) {
 
       // Find the nicest available snippet.
       if (isset($response->highlighting->{$doc->id}->$hl_fl)) {
-        $snippet = theme('apachesolr_search_snippets', $doc, $response->highlighting->{$doc->id}->$hl_fl);
+        $snippet = theme('apachesolr_search_snippets', array('doc' => $doc, 'snippets' => $response->highlighting->{$doc->id}->$hl_fl));
       }
       elseif (isset($doc->teaser)) {
-        $snippet = theme('apachesolr_search_snippets', $doc, array(truncate_utf8($doc->teaser, 256, TRUE)));
+        $snippet = theme('apachesolr_search_snippets', array('doc' => $doc, 'snippets' => array(truncate_utf8($doc->teaser, 256, TRUE))));
       }
       else {
         $snippet = '';
@@ -567,7 +584,7 @@ function apachesolr_search_process_response($response, $query, $params) {
         // template_preprocess_search_result() runs check_plain() on the title
         // again.  Decode to correct the display.
         'title' => htmlspecialchars_decode($doc->title, ENT_QUOTES),
-        'user' => theme('username', $doc),
+        'user' => theme('username', array('name' => $doc->name)), // TODO add link_path
         'date' => $doc->created,
         'node' => $doc,
         'extra' => $extra,
@@ -604,10 +621,10 @@ function apachesolr_search_date_range($query, $facet_field) {
   // facet.date.* params from the DB and determine the best search
   // gap to use.  This callback assumes $delta is 'changed' or 'created'.
   if (!isset($start_iso)) {
-    $start_iso = apachesolr_date_iso(db_result(db_query("SELECT MIN($facet_field) FROM {node} WHERE status = 1")));
+    $start_iso = apachesolr_date_iso(db_query("SELECT MIN($facet_field) FROM {node} WHERE status = 1")->fetchField());
     // Subtract one second, so that this range's $end_iso is not equal to the
     // next range's $start_iso.
-    $end_iso = apachesolr_date_iso(db_result(db_query("SELECT MAX($facet_field) FROM {node} WHERE status = 1")) - 1);
+    $end_iso = apachesolr_date_iso(db_query("SELECT MAX($facet_field) FROM {node} WHERE status = 1")->fetchField() - 1);
     $gap = apachesolr_date_determine_gap($start_iso, $end_iso);
   }
   // Return a query range from the beginning of a gap period to the beginning
@@ -617,7 +634,7 @@ function apachesolr_search_date_range($query, $facet_field) {
 }
 
 /**
- * Implementation of hook_apachesolr_facets().
+ * Implements hook_apachesolr_facets().
  *
  * Returns an array keyed by block delta.
  */
@@ -687,7 +704,7 @@ function apachesolr_search_apachesolr_facets() {
 }
 
 /**
- * Implementation of hook_block().
+ * Implements hook_block().
  */
 function apachesolr_search_block($op = 'list', $delta = 0, $edit = array()) {
   switch ($op) {
@@ -992,7 +1009,7 @@ function apachesolr_search_taxonomy_get_term($tid) {
  */
 function apachesolr_search_get_book($facet, &$options) {
   if (is_numeric($facet)) {
-    return db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $facet));
+    return db_query('SELECT title FROM {node} WHERE nid = %d', $facet)->fetchField();
   }
   else {
     $options['html'] = TRUE;
@@ -1026,7 +1043,7 @@ function apachesolr_search_get_username($facet) {
  * Callback function for the 'Filter by type' facet block.
  */
 function apachesolr_search_get_type($facet) {
-  $type = node_get_types('name', $facet);
+  $type = node_type_get_name($facet);
   if ($type === FALSE && $facet == 'comment') {
     $type = t('Comment');
   }
@@ -1035,7 +1052,7 @@ function apachesolr_search_get_type($facet) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * This adds the 0 option to the search admin form.
  */
@@ -1045,14 +1062,14 @@ function apachesolr_search_form_search_admin_settings_alter(&$form, $form_state)
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  */
 function apachesolr_search_form_search_theme_form_alter(&$form, $form_state) {
   apachesolr_search_form_search_block_form_alter($form, $form_state);
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  */
 function apachesolr_search_form_search_block_form_alter(&$form, $form_state) {
   if (variable_get('apachesolr_search_make_default', 0)) {
@@ -1096,7 +1113,7 @@ function apachesolr_search_search_box_form_submit($form, &$form_state) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * This adds spelling suggestions, retain filters to the search form.
  */
@@ -1186,7 +1203,7 @@ function apachesolr_search_form_search_submit($form, &$form_state) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * This adds options to the apachesolr admin form.
  */
@@ -1202,7 +1219,7 @@ function apachesolr_search_form_apachesolr_settings_alter(&$form, $form_state) {
     ),
     '#default_value' => variable_get('apachesolr_search_browse', 'browse'),
     '#description' => t("This is what is shown when the user enters an empty search, or removes all filters from an active search. Remember to enable filters on the !filterslink and assign blocks to regions on the !blocklink", array(
-      '!filterslink' => l('enabled filters page', 'admin/settings/apachesolr/enabled-filters'),
+      '!filterslink' => l('enabled filters page', 'admin/config/apachesolr/enabled-filters'),
       '!blocklink' => l('block settings page', 'admin/build/block'),
     )),
   );
@@ -1221,7 +1238,7 @@ function apachesolr_search_form_apachesolr_settings_alter(&$form, $form_state) {
     '#type' => 'radios',
     '#title' => t('Use Apache Solr for taxonomy links'),
     '#default_value' => variable_get('apachesolr_search_taxonomy_links', 0),
-    '#description' => t('Note: Vocabularies that need this behavior need to be checked off on the <a href="@enabled_filters_url">enabled filters</a> settings page', array('@enabled_filters_url' => url('admin/settings/apachesolr/enabled-filters'))),
+    '#description' => t('Note: Vocabularies that need this behavior need to be checked off on the <a href="@enabled_filters_url">enabled filters</a> settings page', array('@enabled_filters_url' => url('admin/config/apachesolr/enabled-filters'))),
     '#options' => array(0 => t('Disabled'), 1 => t('Enabled')),
   );
   $form['advanced']['apachesolr_search_taxonomy_previous'] = array(
@@ -1238,10 +1255,13 @@ function apachesolr_search_form_apachesolr_settings_alter(&$form, $form_state) {
 
   $form['#submit'][] = 'apachesolr_search_build_spellcheck';
   $form['#submit'][] = 'apachesolr_search_make_default_submit';
-  // Move buttons to the bottom.
-  $buttons = $form['buttons'];
-  unset($form['buttons']);
-  $form['buttons'] = $buttons;
+
+  if (isset($form['buttons'])) {
+    // Move buttons to the bottom.
+    $buttons = $form['buttons'];
+    unset($form['buttons']);
+    $form['buttons'] = $buttons;
+  }
 }
 
 /**
@@ -1259,7 +1279,7 @@ function apachesolr_search_make_default_submit($form, &$form_state) {
 }
 
 /**
- * Implementation of hook_form_[form_id]_alter().
+ * Implements hook_form_[form_id]_alter().
  *
  * Rebuild (empty) the spellcheck dictionary when the index is deleted..
  */
@@ -1280,7 +1300,7 @@ function apachesolr_search_build_spellcheck() {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function apachesolr_search_theme() {
   return array(
@@ -1387,7 +1407,7 @@ function theme_apachesolr_breadcrumb_uid($field) {
     return variable_get('anonymous', t('Anonymous'));
   }
   else {
-    return db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $field['#value']));
+    return db_query("SELECT name FROM {users} WHERE uid = %d", $field['#value'])->fetchField();
   }
 }
 
@@ -1407,7 +1427,7 @@ function theme_apachesolr_breadcrumb_tid($field) {
  * Return the human readable text for a content type.
  */
 function theme_apachesolr_breadcrumb_type($field) {
-  return node_get_types('name', $field['#value']);
+  return node_type_get_name($field['#value']);
 }
 
 /**
@@ -1415,7 +1435,7 @@ function theme_apachesolr_breadcrumb_type($field) {
  */
 function theme_apachesolr_breadcrumb_is_book_bid($field) {
   if (is_numeric($field['#value'])) {
-    return db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $field['#value']));
+    return db_query('SELECT title FROM {node} WHERE nid = %d', $field['#value'])->fetchField();
   }
   else {
     return t('Not in any book');
@@ -1436,8 +1456,8 @@ function theme_apachesolr_currentsearch($total_found, $links) {
  * @param array $snippets
  *
  */
-function theme_apachesolr_search_snippets($doc, $snippets) {
-  return implode(' ... ', $snippets) .' ...';
+function theme_apachesolr_search_snippets($variables) {
+  return implode(' ... ', $variables['snippets']) .' ...';
 }
 
 function apachesolr_get_parent_terms($tids) {
@@ -1445,7 +1465,7 @@ function apachesolr_get_parent_terms($tids) {
   $parent_terms = array();
   $new_tids = $tids;
   do {
-    $result = db_query(db_rewrite_sql("SELECT t.tid, t.parent FROM {term_hierarchy} t WHERE t.tid IN (". db_placeholders($new_tids) .")", 't', 'tid'), $new_tids);
+    $result = db_query("SELECT t.tid, t.parent FROM {term_hierarchy} t WHERE t.tid IN (". db_placeholders($new_tids) .")", $new_tids);
     $new_tids = array();
     while ($term = db_fetch_object($result)) {
       $parent_terms[$term->tid] = $term;
diff --git a/contrib/apachesolr_commentsearch/apachesolr_commentsearch.install b/contrib/apachesolr_commentsearch/apachesolr_commentsearch.install
index 359536b..fef7034 100644
--- a/contrib/apachesolr_commentsearch/apachesolr_commentsearch.install
+++ b/contrib/apachesolr_commentsearch/apachesolr_commentsearch.install
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function apachesolr_commentsearch_install() {
   // Set apachesolr_index_comments_with_node so that comments aren't
@@ -16,7 +16,7 @@ function apachesolr_commentsearch_install() {
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function apachesolr_commentsearch_uninstall() {
   variable_del('apachesolr_index_comments_with_node');
diff --git a/contrib/apachesolr_commentsearch/apachesolr_commentsearch.module b/contrib/apachesolr_commentsearch/apachesolr_commentsearch.module
index 47308e4..6c7f49e 100644
--- a/contrib/apachesolr_commentsearch/apachesolr_commentsearch.module
+++ b/contrib/apachesolr_commentsearch/apachesolr_commentsearch.module
@@ -2,7 +2,7 @@
 
 
 /**
- * Implementation of hook_apachesolr_document_handlers().
+ * Implements hook_apachesolr_document_handlers().
  *
  * @param string $type
  *   Entity type. 'node', 'comment', and so forth. Used to evaluate whether this module
@@ -169,7 +169,7 @@ function theme_apachesolr_commentsearch_breadcrumb_type($field) {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function apachesolr_commentsearch_theme() {
   return array(
diff --git a/contrib/apachesolr_date/apachesolr_date.install b/contrib/apachesolr_date/apachesolr_date.install
index eeb571e..d91b3ea 100644
--- a/contrib/apachesolr_date/apachesolr_date.install
+++ b/contrib/apachesolr_date/apachesolr_date.install
@@ -2,7 +2,7 @@
 // $Id: apachesolr_date.install,v 1.1.2.1 2010/04/26 03:35:16 jpmckinney Exp $
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function apachesolr_date_uninstall() {
   // Remove blocks.
diff --git a/contrib/apachesolr_date/apachesolr_date.module b/contrib/apachesolr_date/apachesolr_date.module
index 1318177..534dc73 100644
--- a/contrib/apachesolr_date/apachesolr_date.module
+++ b/contrib/apachesolr_date/apachesolr_date.module
@@ -8,7 +8,7 @@
  */
 
 /**
- * Implementation of hook_apachesolr_facets().
+ * Implements hook_apachesolr_facets().
  * Only handles end date facets.
  * Start date facet definitions are handled later.
  * @see apachesolr_date_apachesolr_cck_fields_alter()
@@ -40,7 +40,7 @@ function apachesolr_date_apachesolr_facets() {
 }
 
 /**
- * Implementation of hook_block().
+ * Implements hook_block().
  */
 function apachesolr_date_block($op = 'list', $delta = 0, $edit = array()) {
   switch ($op) {
@@ -99,7 +99,7 @@ function apachesolr_date_block($op = 'list', $delta = 0, $edit = array()) {
 }
 
 /**
- * Implementation of hook_apachesolr_prepare_query().
+ * Implements hook_apachesolr_prepare_query().
  * Adds sorts for enabled date facets to the sorting block.
  */
 function apachesolr_date_apachesolr_prepare_query(&$query) {
@@ -121,7 +121,7 @@ function apachesolr_date_apachesolr_prepare_query(&$query) {
 }
 
 /**
- * Implementation of hook_apachesolr_cck_fields_alter().
+ * Implements hook_apachesolr_cck_fields_alter().
  * This function adds the CCK date fields' definitions to let
  * them be recognized as facets.
  */
diff --git a/contrib/apachesolr_image/apachesolr_image.module b/contrib/apachesolr_image/apachesolr_image.module
index d76aa5e..3c09b5f 100644
--- a/contrib/apachesolr_image/apachesolr_image.module
+++ b/contrib/apachesolr_image/apachesolr_image.module
@@ -2,7 +2,7 @@
 // $Id: apachesolr_image.module,v 1.1.2.1.2.4.2.4 2010/04/25 23:43:00 jpmckinney Exp $
 
 /**
- * Implementation of hook_apachesolr_update_index().
+ * Implements hook_apachesolr_update_index().
  */
 function apachesolr_image_apachesolr_update_index(&$document, $node, $namespace) {
   if ($node->type == 'image' && $document->entity == 'node') {
@@ -27,7 +27,7 @@ function apachesolr_image_apachesolr_update_index(&$document, $node, $namespace)
 }
 
 /**
- * Implementation of hook_apachesolr_modify_query().
+ * Implements hook_apachesolr_modify_query().
  */
 function apachesolr_image_apachesolr_modify_query(&$query, &$params, $caller) {
   // Also retrieve image thumbnail links.
@@ -35,7 +35,7 @@ function apachesolr_image_apachesolr_modify_query(&$query, &$params, $caller) {
 }
 
 /**
- * Implementation of hook_apachesolr_process_results().
+ * Implements hook_apachesolr_process_results().
  */
 function apachesolr_image_apachesolr_process_results(&$results) {
   foreach ($results as $index => $item) {
@@ -50,7 +50,7 @@ function theme_apachesolr_image_snippet($item) {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function apachesolr_image_theme() {
   return array(
@@ -61,7 +61,7 @@ function apachesolr_image_theme() {
 }
 
 /**
- * Implementation of hook_enable().
+ * Implements hook_enable().
  */
 function apachesolr_image_enable() {
   drupal_set_message(t('The Apache Solr image integration module will not have any apparent effect until Image type nodes are indexed or re-indexed.'));
diff --git a/contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module b/contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
index 16a450d..d8da3d1 100644
--- a/contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
+++ b/contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
@@ -2,7 +2,7 @@
 // $Id: apachesolr_nodeaccess.module,v 1.1.2.11.2.3 2009/12/26 12:04:03 robertDouglass Exp $
 
 /**
- * Implementation of apachesolr_update_index
+ * Implements apachesolr_update_index
  */
 function apachesolr_nodeaccess_apachesolr_update_index(&$document, $node, $namespace) {
   static $account;
@@ -59,7 +59,7 @@ function apachesolr_nodeaccess_build_subquery($account) {
 }
 
 /**
- * Implementation of hook_apachesolr_modify_query().
+ * Implements hook_apachesolr_modify_query().
  */
 function apachesolr_nodeaccess_apachesolr_modify_query(&$query, &$params, $caller = 'apachesolr_search') {
   if ($caller == 'apachesolr_views_query') {
@@ -81,7 +81,7 @@ function apachesolr_nodeaccess_apachesolr_modify_query(&$query, &$params, $calle
 }
 
 /**
- * Implementation of hook_nodeapi().
+ * Implements hook_nodeapi().
  *
  * Listen to this hook to find out when a node is being saved.
  */
@@ -96,7 +96,7 @@ function apachesolr_nodeaccess_nodeapi(&$node, $op) {
 }
 
 /**
- * Implementation of hook_node_access_records().
+ * Implements hook_node_access_records().
  *
  * Listen to this hook to find out when a node needs to be re-indexed
  * for its node access grants.
@@ -111,7 +111,7 @@ function apachesolr_nodeaccess_node_access_records($node) {
 }
 
 /**
- * Implementation of hook_form_alter().
+ * Implements hook_form_alter().
  */
 function apachesolr_nodeaccess_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'node_configure_rebuild_confirm') {
diff --git a/contrib/apachesolr_og/apachesolr_og.install b/contrib/apachesolr_og/apachesolr_og.install
index 2012731..4d6f3d9 100644
--- a/contrib/apachesolr_og/apachesolr_og.install
+++ b/contrib/apachesolr_og/apachesolr_og.install
@@ -2,7 +2,7 @@
 // $Id: apachesolr_og.install,v 1.1.2.2.2.3 2010/04/26 03:35:16 jpmckinney Exp $
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function apachesolr_og_uninstall() {
   // Remove blocks.
@@ -10,7 +10,7 @@ function apachesolr_og_uninstall() {
 }
 
 /**
- * Implementation of hook_enable().
+ * Implements hook_enable().
  */
 function apachesolr_og_enable() {
   $facet_missing = variable_get('apachesolr_facet_missing', array());
@@ -21,7 +21,7 @@ function apachesolr_og_enable() {
 }
 
 /**
- * Implementation of hook_disable().
+ * Implements hook_disable().
  */
 function apachesolr_og_disable() {
   // Disable all facets for this module.
diff --git a/contrib/apachesolr_og/apachesolr_og.module b/contrib/apachesolr_og/apachesolr_og.module
index 600a2bf..ea3d578 100644
--- a/contrib/apachesolr_og/apachesolr_og.module
+++ b/contrib/apachesolr_og/apachesolr_og.module
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function apachesolr_og_menu() {
   return array(
@@ -50,7 +50,7 @@ function apachesolr_og_reindex() {
 }
 
 /**
- * Implementation of hook_apachesolr_update_index().
+ * Implements hook_apachesolr_update_index().
  */
 function apachesolr_og_apachesolr_update_index(&$document, $node) {
   // Index group posts
@@ -66,7 +66,7 @@ function apachesolr_og_apachesolr_update_index(&$document, $node) {
 }
 
 /**
- * Implementation of hook_apachesolr_modify_query().
+ * Implements hook_apachesolr_modify_query().
  */
 function apachesolr_og_apachesolr_modify_query(&$query, &$params, $caller) {
   // Fetch the group ID in results - however, this is currently not used.
@@ -77,7 +77,7 @@ function apachesolr_og_apachesolr_modify_query(&$query, &$params, $caller) {
 }
 
 /**
- * Implementation of hook_apachesolr_process_results().
+ * Implements hook_apachesolr_process_results().
  */
 function apachesolr_og_apachesolr_process_results(&$results) {
   $key = apachesolr_og_gid_key();
@@ -122,7 +122,7 @@ function apachesolr_og_gid_key() {
 }
 
 /**
- * Implementation of hook_apachesolr_facets().
+ * Implements hook_apachesolr_facets().
  */
 function apachesolr_og_apachesolr_facets() {
   $key = apachesolr_og_gid_key();
@@ -134,7 +134,7 @@ function apachesolr_og_apachesolr_facets() {
 }
 
 /**
- * Implementation of hook_block().
+ * Implements hook_block().
  */
 function apachesolr_og_block($op = 'list', $delta = 0, $edit = array()) {
   switch ($op) {
@@ -187,7 +187,7 @@ function apachesolr_og_group_name($facet, &$options) {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  *
  * The breadcrumb function assumes that apachesolr_og_gid_key() returns im_og_gid
  * If that changes, modify the theme name appropriately
diff --git a/drush/apachesolr.drush.inc b/drush/apachesolr.drush.inc
index f92c222..4b10833 100644
--- a/drush/apachesolr.drush.inc
+++ b/drush/apachesolr.drush.inc
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_drush_command().
+ * Implements hook_drush_command().
  *
  * In this hook, you specify which commands your
  * drush module makes available, what it does and
@@ -61,7 +61,7 @@ function apachesolr_drush_command() {
 }
 
 /**
- * Implementation of hook_drush_help().
+ * Implements hook_drush_help().
  *
  * This function is called whenever a drush user calls
  * 'drush help <name-of-your-command>'
diff --git a/tests/solr_index_and_search.test b/tests/solr_index_and_search.test
index 48f93a2..8414862 100755
--- a/tests/solr_index_and_search.test
+++ b/tests/solr_index_and_search.test
@@ -3,7 +3,7 @@
 
 class DrupalSolrMatchTestCase extends DrupalWebTestCase {
   /**
-   * Implementation of getInfo().
+   * Implements getInfo().
    */
   function getInfo() {
     return array(
