Last active
August 29, 2015 14:08
-
-
Save acdha/d81613fdce534f2dd3ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/haystack/backends/solr_backend.py b/haystack/backends/solr_backend.py | |
index 777e35f..d1a05b0 100644 | |
--- a/haystack/backends/solr_backend.py | |
+++ b/haystack/backends/solr_backend.py | |
@@ -103,8 +103,9 @@ class SolrSearchBackend(BaseSearchBackend): | |
self.conn.delete(q=" OR ".join(models_to_delete), commit=commit) | |
- # Run an optimize post-clear. http://wiki.apache.org/solr/FAQ#head-9aafb5d8dff5308e8ea4fcf4b71f19f029c4bb99 | |
- self.conn.optimize() | |
+ if commit: | |
+ # Run an optimize post-clear. http://wiki.apache.org/solr/FAQ#head-9aafb5d8dff5308e8ea4fcf4b71f19f029c4bb99 | |
+ self.conn.optimize() | |
except (IOError, SolrError) as e: | |
if not self.silently_fail: | |
raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment