Difference between revisions of "SUNScholar/Indexes/Rebuild"

From Libopedia
Jump to navigation Jump to search
Line 25: Line 25:
 
## Uncomment the relevant lines below              ##
 
## Uncomment the relevant lines below              ##
 
#####################################################
 
#####################################################
## REBUILD: This option will rebuild an existing index that has no new modifications.
+
## REBUILD: This option will reindex an existing index that has no new modifications.
 
#echo "Re-building existing indexes... Please wait"
 
#echo "Re-building existing indexes... Please wait"
 
#/home/dspace/bin/dspace update-discovery-index -b
 
#/home/dspace/bin/dspace update-discovery-index -b

Revision as of 13:27, 7 November 2014

Back to non-SOLR Search and Browse Indexes
Back to SOLR Discovery Search and Browse Indexes

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              ##
#####################################################
## REBUILD: This option will reindex an existing index that has no new modifications.
#echo "Re-building 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

Notes

This comment on a DSpace mailing list may help:

-b destroy the index and rebuild. You will see 0 results if you look at dspace at this moment, and items will be agregated to a 0 lenght index
-f keep the index but reindex all items, so you never see the 0 results, and data will be overwriten

References

Rebuild DSpace

Click on the heading above.