SUNScholar/Indexes/Rebuild/3.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/creation below ##
 * 2) Uncomment the relevant lines below              ##
 * 3) REINDEX: This option will reindex an existing index that has no new modifications.
 * 4) echo "Re-indexing existing indexes... Please wait"
 * 5) /home/dspace/bin/dspace update-discovery-index -b
 * 1) echo "Re-indexing existing indexes... Please wait"
 * 2) /home/dspace/bin/dspace update-discovery-index -b


 * 1) RECREATE: This option will recreate indexes after new index modifications.
 * 2) echo "Re-creating new indexes... Please wait"
 * 3) /home/dspace/bin/dspace update-discovery-index -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