Skip to content

Instantly share code, notes, and snippets.

@r0mdau
Created January 13, 2015 12:45
Show Gist options
  • Save r0mdau/44d95027c12209d14bcf to your computer and use it in GitHub Desktop.
Save r0mdau/44d95027c12209d14bcf to your computer and use it in GitHub Desktop.
Créer un index elasticsearch avec un TTL
curl -XPUT 'http://localhost:9200/twitter/surf/_mapping' -d '{"surf": {"_ttl": {"enabled": true, "default": "1d"}}}'
@r0mdau
Copy link
Author

r0mdau commented Jan 19, 2017

Script pour modifier plusieurs indexes :

#!/bin/bash
cities=( bordeaux nice lyon marseille lille nantes toulouse strasbourg rennes reims montpellier lehavre paris brest )
for i in "${cities[@]}"
do
	curl -XPUT "http://localhost:9200/twitter/_mapping/$i" -d "{\"$i\": {\"_ttl\": {\"enabled\": true, \"default\": \"8d\"}}}"
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment