diff --git a/project_solr.install b/project_solr.install
index a11a66f..caa70dd 100644
--- a/project_solr.install
+++ b/project_solr.install
@@ -1,7 +1,16 @@
 <?php
-
+/**
+ * Installs the project_solr module and enables the project_project
+ * content type to be indexed by solr
+ */
 function project_solr_install() {
   // Reindex all project nodes.
-  db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {node} WHERE type = 'project_project')", time());
-}
-
+  $env_id = apachesolr_default_environment();
+  $bundles = apachesolr_get_index_bundles($env_id, 'node');
+  if (!in_array('project_project', $bundles)) {
+    module_load_include('inc','apachesolr', 'apachesolr.index');
+    $bundles[] = 'project_project';
+    apachesolr_index_set_bundles($env_id,'node', $bundles);
+  }
+  db_query("UPDATE {apachesolr_index_entities_node} SET changed = %d WHERE entity_id IN (SELECT nid FROM {node} WHERE type = 'project_project')", time());
+}
\ No newline at end of file
diff --git a/project_solr.module b/project_solr.module
index 6b9c897..ff7e50d 100644
--- a/project_solr.module
+++ b/project_solr.module
@@ -74,7 +74,7 @@ function project_solr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
     case 'update':
     case 'insert':
       if ($node->type == 'project_release' && $node->status) {
-        apachesolr_mark_node($node->project_release['pid']);
+        apachesolr_mark_entity('node', $node->project_release['pid']);
       }
       break;
   }
@@ -83,20 +83,23 @@ function project_solr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
 /**
  * Implementation of hook_form_alter().
  */
-function project_solr_form_apachesolr_delete_index_form_alter(&$form, $form_state) {
-  $form['reindex_project'] = array(
+function project_solr_form_apachesolr_index_action_form_alter(&$form, $form_state) {
+
+  $form['action']['reindex_project'] = array(
     '#type' => 'submit',
     '#value' => t('Re-index all projects'),
     '#submit' => array('project_solr_reindex_projects'),
   );
-  $form['reindex_project_desc'] = array(
-    '#type' => 'item',
-    '#description' => t('This will only re-index the project content on your site.'),
+  $form['action']['reindex_project_description'] = array(
+    '#type' => 'markup',
+    '#prefix' => '<span>',
+    '#suffix' => '</span>',
+    '#value' => t('This will only re-index the project content on your site.'),
   );
 }
 
 function project_solr_reindex_projects($form, $form_state) {
-  db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {node} WHERE type = 'project_project')", time());
+  db_query("UPDATE {apachesolr_index_entities_node} SET changed = %d WHERE entity_id IN (SELECT nid FROM {node} WHERE type = 'project_project')", time());
   drupal_set_message(t('Marked all project content to be reindexed by Apache Solr.'));
 }
 
@@ -104,17 +107,17 @@ function project_solr_reindex_projects($form, $form_state) {
 // Solr-related hooks
 //----------------------------------------
 
-/**
- * Implementation of hook_apachesolr_facets().
- */
-function project_solr_apachesolr_facets() {
+function project_solr_facetapi_facet_info($searcher_info) {
   $facets = array();
   if (module_exists('project_usage')) {
-    $facets = array(
-      'sort_most_installed' => array(
-        'info' => t('Most installed'),
-        'facet_field' => 'sis_project_release_usage',
-        'direction' => 'desc',
+    $facets['sort_most_installed'] = array(
+      'field' => 'sis_project_release_usage',
+      'label' => t('Most installed'),
+      'description' => t('Filter Most installed'),
+      'default sorts' => array(
+        array('active', SORT_DESC),
+        array('count', SORT_DESC),
+        array('display', SORT_DESC),
       ),
     );
   }
@@ -122,7 +125,7 @@ function project_solr_apachesolr_facets() {
 }
 
 /**
- * Implementation of hook_apachesolr_update_index().
+ * Implementation of hook_apachesolr_index_document_build_ENTITY_TYPE().
  *
  * This adds information about releases for the project to the Solr document
  * so we can facet on releases (API compatibility terms, usage, etc), along
@@ -132,26 +135,41 @@ function project_solr_apachesolr_facets() {
  * here to check that we're really dealing with a project node before trying
  * to access any project-specifc data.
  */
-function project_solr_apachesolr_update_index(&$document, $node) {
+function project_solr_apachesolr_index_document_build_node(ApacheSolrDocument $document, $node, $env_id) {
   if (!empty($node->project['uri'])) {
-    $document->ss_project_uri = $node->project['uri'];
+    $document->addField('ss_project_uri', $node->project['uri']);
   }
   if (!empty($node->project)) {
     // The initial "bs" is for boolean/single.
-    $document->bs_project_sandbox = !empty($node->project['sandbox']) ? '1' : '0';
+    $project_is_andbox = !empty($node->project['sandbox']) ? '1' : '0';
+    $document->addField('bs_project_sandbox', $project_is_sandbox);
   }
   if (module_exists('project_release') && !empty($node->project_release['releases'])) {
-    $document->bs_project_has_releases = '1';
+    $document->addField('bs_project_has_releases', '1');
 
     $max_filetime = 0;
     $max_official_filetime = 0;
-    $term_query = db_query("SELECT DISTINCT(tn.tid) FROM {node} n INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE prn.pid = %d AND td.vid = %d", $node->nid, _project_release_get_api_vid());
+    $raw_term_query = 'SELECT DISTINCT(tn.tid)
+      FROM {node} n
+      INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid
+      INNER JOIN {term_node} tn ON n.nid = tn.nid
+      INNER JOIN {term_data} td ON tn.tid = td.tid
+      WHERE prn.pid = %d AND td.vid = %d';
+    $term_query = db_query($raw_term_query, $node->nid, _project_release_get_api_vid());
     while ($term = db_fetch_object($term_query)) {
       $document->setMultiValue('im_project_release_api_tids', $term->tid);
-      $latest_activity = db_fetch_object(db_query_range("SELECT f.timestamp, prn.rebuild FROM {node} n INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid INNER JOIN {project_release_file} prf ON prn.nid = prf.nid INNER JOIN {term_node} tn ON prn.nid = tn.nid INNER JOIN {files} f ON prf.fid = f.fid WHERE n.status = 1 AND tn.tid = %d AND prn.pid = %d ORDER BY f.timestamp DESC", $term->tid, $node->nid, 0, 1));
+      $raw_latest_activity_query = "SELECT f.timestamp, prn.rebuild
+        FROM {node} n
+        INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid
+        INNER JOIN {project_release_file} prf ON prn.nid = prf.nid
+        INNER JOIN {term_node} tn ON prn.nid = tn.nid
+        INNER JOIN {files} f ON prf.fid = f.fid
+        WHERE n.status = 1 AND tn.tid = %d AND prn.pid = %d
+        ORDER BY f.timestamp DESC";
+      $latest_activity = db_fetch_object(db_query_range($raw_latest_activity_query, $term->tid, $node->nid, 0, 1));
       $filetime = $latest_activity->timestamp;
       $key = 'ds_project_latest_activity_'. $term->tid;
-      $document->$key = apachesolr_date_iso($filetime);
+      $document->addField($key, apachesolr_date_iso($filetime));
       if ($filetime > $max_filetime) {
         $max_filetime = $filetime;
       }
@@ -160,15 +178,23 @@ function project_solr_apachesolr_update_index(&$document, $node) {
       $key = 'ds_project_latest_release_'. $term->tid;
       if ($latest_activity->rebuild == 0) {
         // The latest activity is official, we're done.
-        $document->$key = apachesolr_date_iso($filetime);
+        $document->addField($key, apachesolr_date_iso($filetime));
         if ($filetime > $max_official_filetime) {
           $max_official_filetime = $filetime;
         }
       }
       else {
-        $filetime = db_result(db_query_range("SELECT f.timestamp FROM {node} n INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid INNER JOIN {project_release_file} prf ON prn.nid = prf.nid INNER JOIN {term_node} tn ON prn.nid = tn.nid INNER JOIN {files} f ON prf.fid = f.fid WHERE n.status = 1 AND prn.rebuild = 0 AND tn.tid = %d AND prn.pid = %d ORDER BY f.timestamp DESC", $term->tid, $node->nid, 0, 1));
+        $raw_filetime_query = "SELECT f.timestamp
+          FROM {node} n
+          INNER JOIN {project_release_nodes} prn ON n.nid = prn.nid
+          INNER JOIN {project_release_file} prf ON prn.nid = prf.nid
+          INNER JOIN {term_node} tn ON prn.nid = tn.nid
+          INNER JOIN {files} f ON prf.fid = f.fid
+          WHERE n.status = 1 AND prn.rebuild = 0 AND tn.tid = %d AND prn.pid = %d
+          ORDER BY f.timestamp DESC";
+        $filetime = db_result(db_query_range($raw_filetime_query, $term->tid, $node->nid, 0, 1));
         if (!empty($filetime)) {
-          $document->$key = apachesolr_date_iso($filetime);
+          $document->addField($key, apachesolr_date_iso($filetime));
         }
         if ($filetime > $max_official_filetime) {
           $max_official_filetime = $filetime;
@@ -176,12 +202,12 @@ function project_solr_apachesolr_update_index(&$document, $node) {
       }
     }
     // Set Latest Activity to be the last file update time for the newest release on the project.
-    $document->ds_project_latest_activity = apachesolr_date_iso($max_filetime);
+    $document->addField("ds_project_latest_activity", apachesolr_date_iso($max_filetime));
     if (!empty($max_official_filetime)) {
       // Set Latest Release to be the last file update time for an official release on the project.
-      $document->ds_project_latest_release = apachesolr_date_iso($max_official_filetime);
+      $document->addField("ds_project_latest_release", apachesolr_date_iso($max_official_filetime));
     }
-    
+
     if (module_exists('project_usage')) {
       $weeks = variable_get('project_usage_active_weeks', array());
       $week = reset($weeks);
@@ -189,10 +215,10 @@ function project_solr_apachesolr_update_index(&$document, $node) {
       $query = db_query("SELECT * FROM {project_usage_week_project} WHERE nid = %d AND timestamp = %d", $node->nid, $week);
       while ($usage = db_fetch_object($query)) {
         $key = 'sis_project_release_usage_'. $usage->tid;
-        $document->$key = $usage->count;
+        $document->addField($key, $usage->count);
         $total_usage += $usage->count;
       }
-      $document->sis_project_release_usage = $total_usage;
+      $document->addField('sis_project_release_usage' ,$total_usage);
     }
   }
 }
@@ -206,38 +232,38 @@ function project_solr_apachesolr_update_index(&$document, $node) {
  * allow searching for results matching any of Y or Z inside of vocabulary X.
  * e.g. Return all themes that are Fixed OR Fluid.
  */
-function project_solr_apachesolr_modify_query(&$query, &$params) {
+function project_solr_apachesolr_query_alter(SolrBaseQuery &$query) {
   $filter_set = array();
   // Grab vids for all project-type-related vocabularies
   $vocabs = project_get_related_tids_map(TRUE);
   $project_type_related_vids = array_keys($vocabs);
 
-  foreach ($query->get_filters() as $filter) {
+  foreach ($query->getFilters() as $filter) {
     // Grab any project-type-related filters (im_vid_X filters).
     if (preg_match('/^im_vid_(.*)$/', $filter['#name'], $matches)) {
       if (in_array($matches[1], $project_type_related_vids)) {
         $filter_set[$filter['#name']][] = $filter['#value'];
-        $query->remove_filter($filter['#name'], $filter['#value']);
+        $query->removeFilter($filter['#name'], $filter['#value']);
       }
     }
   }
   // Add the project-type-related filters back as an OR list.
   foreach ($filter_set as $name => $filters) {
     $tid_query = apachesolr_drupal_query();
-    foreach ($filters as $value) {  
-      $tid_query->add_filter($name, $value);
+    foreach ($filters as $value) {
+      $tid_query->addFilter($name, $value);
     }
-    $query->add_subquery($tid_query, 'OR');
+    $query->addFilterSubQuery($tid_query, 'OR');
   }
 
   // If we don't have any explicit filter for the sandbox status projects,
   // add an explicit exclusion for sandbox projects or their related content
   // (e.g. issues from sandbox projects). We want this for all solr queries.
-  if (!$query->get_filters('bs_project_sandbox')) {
+  if (!$query->getFilters('bs_project_sandbox')) {
     // If not defined, we want to *hide* sandboxes (to match the
     // #default_value for the exposed filter), hence 1, with the third
     // 'exclude' parameter set to TRUE (inverts the sense of the filter).
-    $query->add_filter('bs_project_sandbox', '1', TRUE);
+    $query->addFilter('bs_project_sandbox', '1', TRUE);
 
     // As we're building the query for the project browsing pages, we try to
     // add this filter to hide projects without releases, but only if the
@@ -245,27 +271,27 @@ function project_solr_apachesolr_modify_query(&$query, &$params) {
     // above to exclude sandbox content won't have been added yet, so we won't
     // have the filter for releases, either, unless we add it here ourselves
     // (but only if we're building a query for project nodes).
-    if ($query->has_filter('type', 'project_project') && module_exists('project_release')) {
-      $query->add_filter('bs_project_has_releases', '1');
+    if ($query->hasFilter('type', 'project_project') && module_exists('project_release')) {
+      $query->addFilter('bs_project_has_releases', '1');
     }
   }
 }
 
 /**
  * Implementation of hook_apachesolr_prepare_query().
- * 
+ *
  * This just adds an alias to allow the im_project_release_api_tids to present
  * itself as something different in the url. In the default case, instead of
  * im_project_release_api_tids displaying in the url, api_version will display
  * in the url, making the url more user-friendly.
  */
-function project_solr_apachesolr_prepare_query(&$query, &$params) {
+function project_solr_apachesolr_query_prepare(SolrBaseQuery &$query) {
   if (module_exists('project_release')) {
     // Add a human-readable alias for the release filter.
-    $query->add_field_aliases(array('im_project_release_api_tids' => variable_get('project_solr_project_release_api_tids_alias', 'api_version')));
+    $query->addFieldAliases(array('im_project_release_api_tids' => variable_get('project_solr_project_release_api_tids_alias', 'api_version')));
   }
   // Only add the project-specific sort if the query is filtering on projects.
-  if ($query->has_filter('type', 'project_project')) {
+  if ($query->hasFilter('type', 'project_project')) {
     project_solr_add_sorts($query);
   }
 }
@@ -734,7 +760,7 @@ function project_solr_browse_projects_form(&$form_state, $project_type, $path) {
 
 /**
  * Return a Form API array for a sort selector field.
- * 
+ *
  * @param string $label
  *   Optional form label for the sort selector field.
  *
@@ -742,19 +768,16 @@ function project_solr_browse_projects_form(&$form_state, $project_type, $path) {
  *   Form array for the sort selector field.
  */
 function project_solr_get_solrsort_field($label = NULL) {
-  // Get search environment.
-  $env_id = apachesolr_default_environment();
-
   // Pull the current query, so that we can default the sorts
   // and provide an accurate list of available sorting methods.
-  $query = apachesolr_current_query($env_id);
+  $query = apachesolr_current_query();
 
   // Pull the currently selected sort.
-  $solrsort = $query->getSolrsort();
+  $solrsort = $query->get_solrsort();
 
   // Pull all of the available sorts and create an options array.
   $options = array();
-  $available_sorts = $query->getAvailableSorts();
+  $available_sorts = $query->get_available_sorts();
   foreach ($available_sorts as $name => $field) {
     $options[$name . ' ' . $field['default']] = $field['title'];
   }
@@ -796,8 +819,8 @@ function project_solr_browse_projects_form_submit($form, &$form_state) {
   }
 
   // Rewrite solrsort parameter with API version tid, if necessary.
-  $solrsort = explode(' ', $form_state['values']['solrsort']);  
-  if (module_exists('project_release') && !empty($form_state['values']['api_version'])) {    
+  $solrsort = explode(' ', $form_state['values']['solrsort']);
+  if (module_exists('project_release') && !empty($form_state['values']['api_version'])) {
     if ($solrsort[0] == 'ds_project_latest_release' || $solrsort[0] == 'ds_project_latest_activity') {
       $solrsort[0] .= '_'. $form_state['values']['api_version'];
     }
@@ -895,7 +918,7 @@ function project_sort_freetext_submit($form, &$form_state) {
  */
 function project_solr_run_project_query($base_path, $filters = array()) {
   $filterstring = isset($_GET['filters']) ? $_GET['filters'] : '';
-  $query = apachesolr_drupal_query('', $filterstring, '', $base_path);  
+  $query = apachesolr_drupal_query('', $filterstring, '', $base_path);
 
   // Figure out all the fields we need to use as facets.
   // First handle all the implicit filters we're going to add ourselves.
@@ -916,8 +939,8 @@ function project_solr_run_project_query($base_path, $filters = array()) {
     'start' => 0,
     'rows' => 5,  // TODO: make this configurable.
     'facet.field' => $facet_fields,
-    // Filters are set below via explicit calls to add_filter() rather than 
-    // here in the $params array. This is because any filters passed to 
+    // Filters are set below via explicit calls to add_filter() rather than
+    // here in the $params array. This is because any filters passed to
     // apachesolr_drupal_query() will override filters set via the $params
     // array during the prepare_query() invocation.
     'fq' => array(),
@@ -968,7 +991,7 @@ function project_solr_run_project_query($base_path, $filters = array()) {
 
 /**
  * Return a Form API array for an API version selector field.
- * 
+ *
  * @param object $query
  *   An existing query object that we can check for existing filters.
  * @param string $label
@@ -1006,8 +1029,8 @@ function project_solr_get_api_version_field($query, $label = NULL) {
 
 /**
  * Adds project-specific sorts to the query object
- * 
- * Adds project-specific sorts to the query object to allow all queries to 
+ *
+ * Adds project-specific sorts to the query object to allow all queries to
  * leverage project-specific sorting if relevant. This is necessary to allow
  * site-wide search to sort by any project-specific sorting method. This is
  * called by hook_prepare_query() to add the sorts into all queries, but
@@ -1016,14 +1039,14 @@ function project_solr_get_api_version_field($query, $label = NULL) {
  * provide meaningful options for Latest release and Recent activity so that
  * we don't end up with multiple sorts with the same name. This is particularly
  * relevant for how the sorts display in the apachesolr generated sort block.
- * 
+ *
  * @param object &$query
  *   An existing query object to add sorts into.
  * @param string $api_filter
  *   A string representing the name of the filter where our version tids will
  *   be located. This is necessary since, at times, both the base string name
  *   im_project_release_api_tids and the alias are passed in.
- *   
+ *
  * @see apachesolr_block
  */
 function project_solr_add_sorts(&$query, $api_filter = 'im_project_release_api_tids') {
@@ -1073,7 +1096,7 @@ function project_solr_render_search_result($result) {
   if (!empty($project->project_release['releases'])) {
     $project->download_table = project_release_table($project, 'recommended', 'all', t('Version'), FALSE, FALSE);
   }
-  
+
   $project->links = array();
   $project->links['read_more'] = array(
     'title' => t('Find out more'),
@@ -1103,11 +1126,11 @@ function theme_project_solr_no_count_facet_link($facet_text, $path, $options = a
 
 /**
  * This generates a form containing version selection and a submit button.
- * 
+ *
  * Generate a form with a version selection to allow filtering page content
  * based on the API compatibility version. Also includes path to allow the
  * form to potentially submit to other urls if desired.
- * 
+ *
  * @param string $path
  *   The base path to which the version form will redirect.
  * @param string $label
@@ -1138,14 +1161,14 @@ function project_solr_version_form(&$form_state, $path, $label = NULL) {
 
 /**
  * Create a query with the right version filter and redirect to the right page.
- * 
+ *
  * Create a new query, add any version filtering if it was selected in the
  * form, and redirect back to the relevant page with the appropriate filter
  * string.
  */
 function project_solr_version_form_submit($form, &$form_state) {
   // We create a new query with our base path so that we don't need to remove
-  // any existing drupal_core selection, and so that the implict type and 
+  // any existing drupal_core selection, and so that the implict type and
   // module tid filters don't end up in the url string.
   $query = apachesolr_drupal_query('', '', '', $form_state['values']['path']);
 
