Created
January 13, 2015 12:45
-
-
Save r0mdau/44d95027c12209d14bcf to your computer and use it in GitHub Desktop.
Créer un index elasticsearch avec un TTL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT 'http://localhost:9200/twitter/surf/_mapping' -d '{"surf": {"_ttl": {"enabled": true, "default": "1d"}}}' |
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
Modifier le TTL