#!/bin/bash # Default parameters COLLECTION=${1:-zylk} SERVER=${2:-localhost} PORT=${3:-8983} if [ -z "$1" ]; then # Usage echo 'Usage: truncate-collection.sh [ ]' else # Truncate curl -X POST http://${SERVER}:${PORT}/solr/${COLLECTION}/update?commit=true -H "Content-Type: text/xml" --data-binary '*:*' # Reload curl "http://${SERVER}:${PORT}/solr/admin/collections?action=RELOAD&name=${COLLECTION}" fi