Created
March 8, 2013 15:04
-
-
Save radu-gheorghe/5117021 to your computer and use it in GitHub Desktop.
different TTL for parents and children test. Assumes:
$ tail -1 /etc/elasticsearch/elasticsearch.yml
indices.ttl.interval: 1s
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 -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test | |
curl -XPUT localhost:9200/test/p/_mapping -d '{ | |
"p" :{ | |
"_ttl" : { "enabled" : true, "default": "10s" } | |
} | |
}' | |
curl -XPUT localhost:9200/test/c/_mapping -d '{ | |
"c" :{ | |
"_ttl" : { "enabled" : true, "default": "20s" } | |
} | |
}' | |
curl -XPUT localhost:9200/test/p/1 -d '{"foo":"bar"}' | |
curl -XPUT 'localhost:9200/test/c/2?parent=1' -d '{"foo":"bar"}' | |
curl -XPOST localhost:9200/test/_refresh | |
echo | |
curl localhost:9200/test/_search?pretty | |
sleep 5 | |
curl -XPOST localhost:9200/test/_refresh | |
curl localhost:9200/test/_search?pretty | |
sleep 10 | |
echo parent should disappear | |
curl -XPOST localhost:9200/test/_refresh | |
curl localhost:9200/test/_search?pretty | |
sleep 10 | |
echo no hits | |
curl -XPOST localhost:9200/test/_refresh | |
curl localhost:9200/test/_search?pretty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment