Difference between revisions of "SUNScholar/Indexes/Rebuild/3.X"

From Libopedia
Jump to navigation Jump to search
m (Text replacement - "/home/dspace" to "$HOME")
Line 11: Line 11:
  
 
Create a scripts folder.
 
Create a scripts folder.
  mkdir $HOME/scripts
+
  mkdir /home/dspace/scripts
 
Create the script.
 
Create the script.
  nano $HOME/scripts/build-indexes
+
  nano /home/dspace/scripts/build-indexes
  
 
Copy and paste the following.
 
Copy and paste the following.
Line 25: Line 25:
 
## REINDEX: This option will reindex an existing index that has no new modifications.
 
## REINDEX: This option will reindex an existing index that has no new modifications.
 
#echo "Re-indexing existing indexes... Please wait"
 
#echo "Re-indexing existing indexes... Please wait"
#$HOME/bin/dspace update-discovery-index -b
+
#/home/dspace/bin/dspace update-discovery-index -b
  
 
## RECREATE: This option will recreate indexes after new index modifications.
 
## RECREATE: This option will recreate indexes after new index modifications.
 
#echo "Re-creating new indexes... Please wait"
 
#echo "Re-creating new indexes... Please wait"
#$HOME/bin/dspace update-discovery-index -f
+
#/home/dspace/bin/dspace update-discovery-index -f
  
 
#######################################################################
 
#######################################################################
Line 39: Line 39:
 
#sudo service tomcat6 stop
 
#sudo service tomcat6 stop
 
#sleep 5
 
#sleep 5
#$HOME/bin/dspace index-init
+
#/home/dspace/bin/dspace index-init
 
#sudo service tomcat6 start
 
#sudo service tomcat6 start
 
</pre>
 
</pre>
Line 46: Line 46:
  
 
Make the script executable.
 
Make the script executable.
  chmod 0755 $HOME/scripts/build-indexes
+
  chmod 0755 /home/dspace/scripts/build-indexes
  
 
Now you can re-build your indexes '''WHEN NEEDED''' by simply typing;
 
Now you can re-build your indexes '''WHEN NEEDED''' by simply typing;
  $HOME/scripts/build-indexes
+
  /home/dspace/scripts/build-indexes

Revision as of 21:25, 15 June 2015

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.

#!/bin/bash

#####################################################
## Select an option for index build/creation below ##
## Uncomment the relevant lines below              ##
#####################################################
## REINDEX: This option will reindex an existing index that has no new modifications.
#echo "Re-indexing existing indexes... Please wait"
#/home/dspace/bin/dspace update-discovery-index -b

## RECREATE: This option will recreate indexes after new index modifications.
#echo "Re-creating new indexes... Please wait"
#/home/dspace/bin/dspace update-discovery-index -f

#######################################################################
## 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 tomcat6 stop
#sleep 5
#/home/dspace/bin/dspace index-init
#sudo service tomcat6 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