Browse Source

changes to import script to hopefully resolve Solr Java crashing

main
Simon Bowie 2 years ago
parent
commit
065fe7934a
1 changed files with 24 additions and 13 deletions
  1. +24
    -13
      solr_import.sh

+ 24
- 13
solr_import.sh View File



#docker exec -ti --user=solr solr bash -c "cp -r /opt/solr/example/files/conf/* /var/solr/data/$core/conf/" #docker exec -ti --user=solr solr bash -c "cp -r /opt/solr/example/files/conf/* /var/solr/data/$core/conf/"


docker restart solr
#docker restart solr


sleep 30 sleep 30


docker run --rm -v "$directory/$location:/$core" --network=host solr:latest post -c $core /$core docker run --rm -v "$directory/$location:/$core" --network=host solr:latest post -c $core /$core
} }

Import_recursive()
{
docker run --rm -v "$directory/$subdirectory:/$core" --network=host solr:latest post -c $core /$core
}
############################################################ ############################################################
############################################################ ############################################################
# Main program # # Main program #
############################################################ ############################################################


# Set variables # Set variables
directory="/Users/ad7588/projects/patent_site"
directory="/Users/ad7588/projects/patent_site/data"


# Get the options # Get the options
while getopts ":hlimzaespxdw" option; do while getopts ":hlimzaespxdw" option; do
exit;; exit;;
z) # index all z) # index all
core="all" core="all"
location="data/POP Dataset 2022"
Import
docker exec -it solr bin/solr delete -c $core
docker exec -it solr solr create_core -c $core -d custom
location="POP_Dataset_2022"
for subdirectory in $location/*/
do
subdirectory=${subdirectory%*/} # remove the trailing "/"
Import_recursive
done
exit;; exit;;
a) # index ACTIVE folder a) # index ACTIVE folder
core="active" core="active"
location="data/pop_rtfs/ACTIVE (160)"
location="pop_rtfs/ACTIVE (160)"
Import Import
exit;; exit;;
e) # index EXPANDING folder e) # index EXPANDING folder
core="expanding" core="expanding"
location="data/pop_rtfs/EXPANDING (169)"
location="pop_rtfs/EXPANDING (169)"
Import Import
exit;; exit;;
i) # index INVISIBLE folder i) # index INVISIBLE folder
core="invisible" core="invisible"
location="data/pop_rtfs/IN.VISIBLE (204)"
location="pop_rtfs/IN.VISIBLE (204)"
Import Import
exit;; exit;;
m) # index MULTI-SPECIES folder m) # index MULTI-SPECIES folder
core="multispecies" core="multispecies"
location="data/pop_rtfs/MULTI-SPECIES (180)"
location="pop_rtfs/MULTI-SPECIES (180)"
Import Import
exit;; exit;;
p) # index PISSING & LEAKING folder p) # index PISSING & LEAKING folder
core="pissing" core="pissing"
location="data/pop_rtfs/PISSING & LEAKING (168)"
location="pop_rtfs/PISSING & LEAKING (168)"
Import Import
exit;; exit;;
x) # index SECRET folder x) # index SECRET folder
core="secret" core="secret"
location="data/pop_rtfs/SECRET (92)"
location="pop_rtfs/SECRET (92)"
Import Import
exit;; exit;;
d) # index SELF-DEFENDING folder d) # index SELF-DEFENDING folder
core="defending" core="defending"
location="data/pop_rtfs/SELF-DEFENDING (115)"
location="pop_rtfs/SELF-DEFENDING (115)"
Import Import
exit;; exit;;
s) # index SURVIVING folder s) # index SURVIVING folder
core="surviving" core="surviving"
location="data/pop_rtfs/SURVIVING (166)"
location="pop_rtfs/SURVIVING (166)"
Import Import
exit;; exit;;
w) # index WORKING folder w) # index WORKING folder
core="working" core="working"
location="data/pop_rtfs/WORKING (101)"
location="pop_rtfs/WORKING (101)"
Import Import
exit;; exit;;
\?) # Invalid option \?) # Invalid option

Loading…
Cancel
Save