aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-03-06 18:49:09 +0000
committerfrancis <francis>2008-03-06 18:49:09 +0000
commit57e3bc7bdcaec0d5d82a6c401e069269bf480a88 (patch)
tree693f9e86be5161501fbcefc7adb2dee970487ce7
parentc1099db3212c200a60ad7835589cfb636e975728 (diff)
Monkeypatch acts_as_solr so doesn't connect to solr on saving
-rw-r--r--config/environment.rb21
-rw-r--r--todo.txt7
2 files changed, 26 insertions, 2 deletions
diff --git a/config/environment.rb b/config/environment.rb
index 5de47aabe..d79f52539 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -128,3 +128,24 @@ module ActiveRecord
end
end
end
+
+# Monkeypatch! Make it so :if really turns off all access to solr on saving.
+module ActsAsSolr
+ module InstanceMethods
+ # saves to the Solr index
+ def solr_save
+ return true unless configuration[:if]
+ if evaluate_condition(configuration[:if], self)
+ logger.debug "solr_save: #{self.class.name} : #{record_id(self)}"
+ solr_add to_solr_doc
+ solr_commit if configuration[:auto_commit]
+ true
+ else
+ # XXX commented out - so when new requests arrive no connection is
+ # made to solr, in case it is broken.
+ # solr_destroy
+ end
+ end
+ end
+end
+
diff --git a/todo.txt b/todo.txt
index 34b42f78c..02150fefc 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,7 +1,5 @@
Search:
-Security of port access
-
Go to correct id for incoming / outgoing messages
Show correct extract for incoming / outgoing messages
Add indexing of PDFs and DOCs etc.
@@ -9,6 +7,7 @@ Pagination - http://www.quarkruby.com/2007/8/12/acts_as_solr-for-search-and-face
Date ranges and types and stuff
Highlighting - http://www.quarkruby.com/2007/9/14/advanced-acts_as_solr
+
FOI requests to use to test it
==============================
@@ -24,6 +23,10 @@ BAILII - relationship with law courts, robots.txt ?
Next
====
+Tidy up display of these two:
+http://www.whatdotheyknow.com/request/information_on_m27_climbing_lane
+http://www.whatdotheyknow.com/request/identity_card_scheme_expenditure
+
Need something to mark contact as bad, e.g. for university of huddersfield
This is knackered: