Skip to content

Instantly share code, notes, and snippets.

@mynameiswhm
mynameiswhm / reindex.sh
Created Dec 4, 2015
Bulk reindexing elasticsearch to another cluster using jq
View reindex.sh
#/bin/bash
if [ $# -lt 3 ]
then
echo "Usage: reindex.sh source_url target_url index [query]"
echo "Example: reindex.sh http://source.com:9200 http://target.com:9200 products_v1 '{\"query\":{\"range\":{\"mod_date\":{\"from\":\"2015-12-03T20:00:00\"}}}}'"
exit 1
fi
SOURCE_URL=$1