aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/rebuild-solr-index16
-rwxr-xr-xscript/update-solr-index6
2 files changed, 22 insertions, 0 deletions
diff --git a/script/rebuild-solr-index b/script/rebuild-solr-index
new file mode 100755
index 000000000..5d21b999b
--- /dev/null
+++ b/script/rebuild-solr-index
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Reindex everything in Solr, not just changed things
+
+LOC=`dirname $0`
+
+# Info requests are updated incrementally by update-solr-index, so first set
+# them all to not up to date, then rebuild.
+$LOC/runner "ActiveRecord::Base.connection.execute(\"update info_requests set solr_up_to_date = 'f'\")"
+$LOC/runner 'InfoRequest.update_solr_index()'
+
+# These are updated in real time when the model is changed - so they aren't
+# called in update-solr-index. So for this rebuild script, just rebuild them.
+$LOC/runner 'PublicBody.rebuild_solr_index()'
+$LOC/runner 'User.rebuild_solr_index()'
+
diff --git a/script/update-solr-index b/script/update-solr-index
index 33415aa9c..75e4304eb 100755
--- a/script/update-solr-index
+++ b/script/update-solr-index
@@ -2,6 +2,12 @@
LOC=`dirname $0`
+# Info request (and hence incoming and outgoing message) indexing is updated
+# incrementally by this separate batch job. This is so when an incoming
+# message arrives it doesn't have to call Solr, so errors in the indexing won't
+# go back to public body.
$LOC/runner 'InfoRequest.update_solr_index()'
+# Public bodies and users are updated by the model, immediately when it is saved.
+# So nothing to do for them.