SUNScholar/Indexes/Rebuild/6.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
Note: For DSpace 5 & 6 on Ubuntu 16.04
Note that references to the "service" command used to stop and start Tomcat will eventually be deprecated, since Ubuntu has switched to SystemD. See the reference guide for more details.
Copy and paste the following.
#!/bin/bash ##################################################### ## Select an option for index build/update below ## ## Uncomment the relevant lines below ## ##################################################### ## REINDEX: (re)build index, wiping out current one if it exists. #echo "Re-indexing existing indexes... Please wait" #/home/dspace/bin/dspace index-discovery -b -s ## RECREATE: if updating existing index, force each handle to be reindexed even if uptodate #echo "Re-creating new indexes... Please wait" #/home/dspace/bin/dspace index-discovery -f -s ####################################################################### ## This is only required if you use the old browse indexes ## ## Since DSpace version 4.2, discovery is default ## ## Uncomment the lines below with a single hash to enable, if needed ## ####################################################################### #echo "Building non-SOLR search and browse indexes... Please wait" #sudo service tomcat8 stop #sleep 5 #/home/dspace/bin/dspace index-init #sudo service tomcat8 start
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
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