26 lines
841 B
Bash
26 lines
841 B
Bash
#!/bin/bash
|
|
|
|
. ./setenv.sh
|
|
|
|
ARG_SOLR_SHARD_IDS=$1
|
|
ARG_SOLR_SHARDS=$2
|
|
ARG_SOLR_NODE_ID=$3
|
|
ARG_SOLR_NODES=$4
|
|
|
|
if [[ ! -z "$ARG_SOLR_SHARD_IDS" ]]; then
|
|
if [[ ! -z "$ARG_SOLR_SHARDS" ]]; then
|
|
echo "The expected number of shards is required"
|
|
exit 1
|
|
fi
|
|
if [[ ! -z "$ARG_SOLR_NODE_ID" ]]; then
|
|
ARG_SOLR_NODE_ID=1
|
|
fi
|
|
if [[ ! -z "$ARG_SOLR_NODES" ]]; then
|
|
ARG_SOLR_NODES=1
|
|
fi
|
|
|
|
curl -SsL ${SOLR_BASEURL}/admin/cores?action=newCore\\&core=${SOLR_CORE}\\&storeRef=workspace://SpacesStore\\&numShards=${ARG_SOLR_SHARDS}\\&nodeInstance=${ARG_SOLR_NODE_ID}\\&numNodes=${ARG_SOLR_NODES}\\&template=${SOLR_TEMPLATE}\\&shardIds=${ARG_SOLR_SHARD_IDS}
|
|
else
|
|
curl -SsL ${SOLR_BASEURL}/admin/cores?action=newCore\\&core=${SOLR_CORE}\\&storeRef=workspace://SpacesStore\\&template=${SOLR_TEMPLATE}
|
|
fi
|