Skip to content

Commit a86f32b

Browse files
committed
Make AlphaBrowse indexing compatible with replicated indexes.
Thanks to Anna Headley; progress on VUFIND-856.
1 parent 6fae04d commit a86f32b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

index-alphabetic-browse.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,30 @@ set -x
66
cd "`dirname $0`/import"
77
CLASSPATH="browse-indexing.jar:../solr/lib/*"
88

9-
bib_index="../solr/biblio/index"
10-
auth_index="../solr/authority/index"
9+
# make index work with replicated index
10+
# current index is stored in the last line of index.properties
11+
function locate_index
12+
{
13+
local targetVar=$1
14+
local indexDir=$2
15+
# default value
16+
local subDir="index"
17+
18+
if [ -e $indexDir/index.properties ]
19+
then
20+
# read it into an array
21+
readarray farr < $indexDir/index.properties
22+
# get the last line
23+
indexline="${farr[${#farr[@]}-1]}"
24+
# parse the lastline to just get the filename
25+
subDir=`echo $indexline | sed s/index=//`
26+
fi
27+
28+
eval $targetVar="$indexDir/$subDir"
29+
}
30+
31+
locate_index "bib_index" "../solr/biblio"
32+
locate_index "auth_index" "../solr/authority"
1133
index_dir="../solr/alphabetical_browse"
1234

1335
mkdir -p "$index_dir"

0 commit comments

Comments
 (0)