SUNScholar/Indexes/Rebuild/5.X

Back to Indexes Rebuild

Rationale
After applying customisations, you need to rebuild the indexes. This is required after each change in the indexes configuration.

Procedure
Login to your server: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Prepare_Ubuntu/S01

Create a scripts folder. su - dspace

mkdir /home/dspace/scripts Create the script. nano /home/dspace/scripts/build-indexes

Copy and paste the following.
 * 1) !/bin/bash


 * 1) Select an option for index build/update below   ##
 * 2) Uncomment the relevant lines below              ##
 * 3) REINDEX: (re)build index, wiping out current one if it exists.
 * 4) echo "Re-indexing existing indexes... Please wait"
 * 5) /home/dspace/bin/dspace index-discovery -b -s
 * 1) echo "Re-indexing existing indexes... Please wait"
 * 2) /home/dspace/bin/dspace index-discovery -b -s


 * 1) RECREATE: if updating existing index, force each handle to be reindexed even if uptodate
 * 2) echo "Re-creating new indexes... Please wait"
 * 3) /home/dspace/bin/dspace index-discovery -f -s


 * 1) This is only required if you use the old browse indexes           ##
 * 2) Since DSpace version 4.2, discovery is default                    ##
 * 3) Uncomment the lines below with a single hash to enable, if needed ##
 * 4) echo "Building non-SOLR search and browse indexes... Please wait"
 * 5) sudo service tomcat7 stop
 * 6) sleep 5
 * 7) /home/dspace/bin/dspace index-init
 * 8) sudo service tomcat7 start
 * 1) /home/dspace/bin/dspace index-init
 * 2) sudo service tomcat7 start

Make the script executable. chmod 0755 /home/dspace/scripts/build-indexes

Now you can re-build your indexes WHEN NEEDED by simply typing; /home/dspace/scripts/build-indexes