diff --git a/search_api_solr.install b/search_api_solr.install
index 6c758b6..1cc10f7 100644
--- a/search_api_solr.install
+++ b/search_api_solr.install
@@ -72,6 +72,7 @@ function search_api_solr_uninstall() {
       ->condition('class', 'search_api_solr_service')
       ->execute();
   }
+  variable_del('search_api_solr_last_optimize');
 }
 
 /**
diff --git a/search_api_solr.module b/search_api_solr.module
index 7f22f71..4908356 100644
--- a/search_api_solr.module
+++ b/search_api_solr.module
@@ -47,3 +47,19 @@ function search_api_solr_help($path, array $arg = array()) {
     }
   }
 }
+
+/**
+ * Implements hook_cron().
+ *
+ * Used to execute an optimization operation on all enabled Solr servers once a
+ * day.
+ */
+function search_api_solr_cron() {
+  if (REQUEST_TIME - variable_get('search_api_solr_last_optimize', 0) > 86400) {
+    variable_set('search_api_solr_last_optimize', REQUEST_TIME);
+    $conditions = array('class' => 'search_api_solr_service', 'enabled' => TRUE);
+    foreach (search_api_server_load_multiple(FALSE, $conditions) as $server) {
+      $server->getSolrConnection()->optimize(FALSE, FALSE);
+    }
+  }
+}
diff --git a/service.inc b/service.inc
index b26105e..baa6ff2 100644
--- a/service.inc
+++ b/service.inc
@@ -283,8 +283,8 @@ class SearchApiSolrService extends SearchApiAbstractService {
     try {
       $this->connect();
       $response = $this->solr->addDocuments($documents);
-      if ($response->getHttpStatus() == 200) {
-        $this->solr->commit(TRUE, FALSE, FALSE);
+      if ($response->getHttpStatus() == 200 && !empty($index->options['index_directly'])) {
+        $this->solr->commit(FALSE, FALSE, FALSE);
         return $ret;
       }
       throw new SearchApiException(t('HTTP status !status: !msg.',
@@ -1459,6 +1459,15 @@ class SearchApiSolrService extends SearchApiAbstractService {
   }
 
   /**
+   * @return SearchApiSolrConnection
+   *   The solr connection object used by this server.
+   */
+  public function getSolrConnection() {
+    $this->connect();
+    return $this->solr;
+  }
+
+  /**
    * Get metadata about fields in the Solr/Lucene index.
    *
    * @param boolean $reset
diff --git a/solrconfig.xml b/solrconfig.xml
index 9883bd7..d2e6411 100644
--- a/solrconfig.xml
+++ b/solrconfig.xml
@@ -235,8 +235,8 @@
          when adding documents. http://wiki.apache.org/solr/UpdateXmlMessages
     -->
     <autoCommit>
-      <maxDocs>1000</maxDocs>
-      <maxTime>10000</maxTime>
+      <maxDocs>2000</maxDocs>
+      <maxTime>120000</maxTime>
     </autoCommit>
 
 
