This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
solr-shard-management/solr-remove.sh
2022-05-11 18:51:20 +00:00

18 lines
404 B
Bash
Executable File

#!/bin/bash
. ./setenv.sh
ARG_SOLR_SHARD_ID=$1
if [[ ! -z "$ARG_SOLR_SHARD_ID" ]]; then
SOLR_CORE=${SOLR_CORE}-${ARG_SOLR_SHARD_ID}
fi
echo "Removing a core in the Solr instance ..."
SOLR_URL="${SOLR_BASEURL}/admin/cores?action=UNLOAD&core=${SOLR_CORE}&deleteIndex=true&deleteDataDir=true&deleteInstanceDir=true"
if [[ ! -z "$DEBUG" ]]; then
echo "URL: ${SOLR_URL}"
fi
curl -SsL ${SOLR_URL}