-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex-alphabetic-browse.sh
executable file
·41 lines (30 loc) · 1.38 KB
/
index-alphabetic-browse.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
set -x
cd "`dirname $0`/import"
bib_index="../solr/biblio/index"
auth_index="../solr/authority/index"
index_dir="../solr/alphabetical_browse"
mkdir -p "$index_dir"
function build_browse
{
browse=$1
field=$2
skip_authority=$3
extra_jvm_opts=$4
if [ "$skip_authority" = "1" ]; then
java ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp browse-indexing.jar PrintBrowseHeadings "$bib_index" "$field" "${browse}.tmp"
else
java ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp browse-indexing.jar PrintBrowseHeadings "$bib_index" "$field" "$auth_index" "${browse}.tmp"
fi
sort -T /var/tmp -u -t$'\1' -k1 "${browse}.tmp" -o "sorted-${browse}.tmp"
java -Dfile.encoding="UTF-8" -cp browse-indexing.jar CreateBrowseSQLite "sorted-${browse}.tmp" "${browse}_browse.db"
rm -f *.tmp
mv "${browse}_browse.db" "$index_dir/${browse}_browse.db-updated"
touch "$index_dir/${browse}_browse.db-ready"
}
build_browse "title" "title_fullStr" 1 "-Dbibleech=StoredFieldLeech -Dsortfield=title_sort -Dvaluefield=title_fullStr"
build_browse "topic" "topic_browse"
build_browse "author" "author_browse"
build_browse "lcc" "callnumber-a" 1
build_browse "dewey" "dewey-raw" 1 "-Dbibleech=StoredFieldLeech -Dsortfield=dewey-sort -Dvaluefield=dewey-raw"