SUNScholar/Indexes/Rebuild/4.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. 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) REBUILD: (re)build index, wiping out current one if it exists.
 * 4) echo "Re-building existing indexes... Please wait"
 * 5) /home/dspace/bin/dspace index-discovery -b
 * 1) echo "Re-building existing indexes... Please wait"
 * 2) /home/dspace/bin/dspace index-discovery -b


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


 * 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 tomcat6 stop
 * 6) sleep 5
 * 7) /home/dspace/bin/dspace index-init
 * 8) sudo service tomcat6 start
 * 1) /home/dspace/bin/dspace index-init
 * 2) sudo service tomcat6 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