File tree 1 file changed +24
-2
lines changed 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 6
6
cd " ` dirname $0 ` /import"
7
7
CLASSPATH=" browse-indexing.jar:../solr/lib/*"
8
8
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"
11
33
index_dir=" ../solr/alphabetical_browse"
12
34
13
35
mkdir -p " $index_dir "
You can’t perform that action at this time.
0 commit comments