From 8be15df92b6f310858bea8f89259cbc57091e372 Mon Sep 17 00:00:00 2001 From: Jeff Zemerick Date: Thu, 3 Feb 2022 15:28:25 -0500 Subject: [PATCH] Parameterizing the hostname for indexing and defaulting to localhost. (#24) Co-authored-by: Kevin Risden --- index.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.sh b/index.sh index b5c90f8..0c778d1 100755 --- a/index.sh +++ b/index.sh @@ -1,11 +1,14 @@ #!/usr/bin/env bash + +HOSTNAME=${1:-localhost} + if [ ! -f ./tmdb_solr.json ]; then unzip tmdb_solr.json.zip fi # delete (or wipe) the tmdb index and reindex -curl http://localhost:8983/solr/tmdb/update --data '*:*' -H 'Content-type:text/xml; charset=utf-8' +curl "http://$HOSTNAME:8983/solr/tmdb/update" --data '*:*' -H 'Content-type:text/xml; charset=utf-8' -curl http://localhost:8983/solr/tmdb/update --data '' -H 'Content-type:text/xml; charset=utf-8' +curl "http://$HOSTNAME:8983/solr/tmdb/update" --data '' -H 'Content-type:text/xml; charset=utf-8' -curl 'http://localhost:8983/solr/tmdb/update?commit=true' --data-binary @tmdb_solr.json -H 'Content-type:application/json' +curl "http://$HOSTNAME:8983/solr/tmdb/update?commit=true" --data-binary @tmdb_solr.json -H 'Content-type:application/json'