Skip to content

Instantly share code, notes, and snippets.

@mackd
Created March 22, 2012 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackd/2159205 to your computer and use it in GitHub Desktop.
Save mackd/2159205 to your computer and use it in GitHub Desktop.
recreate problem with updating refresh_interval at runtime
# Run this on a completely vanilla, fresh instance of elasticsearch 0.19.x
# Create index with initial -1 refresh interval.
curl -XPUT 'http://localhost:9200/twitter/?pretty=true' -d '
index :
refresh_interval: "-1"
'
# Update refresh interval using update settings to 1s.
curl -XPUT localhost:9200/twitter/_settings?pretty=true -d '{
"index" : {
"refresh_interval" : "1s"
}
}'
# "Get Settings" reports that it has been changed.
curl -XGET localhost:9200/twitter/_settings?pretty=true
# Add item to index.
curl -XPUT 'http://localhost:9200/twitter/tweet/1?pretty=true' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}'
# Can't find it.
curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true'
#########################
# Restart elasticsearch #
#########################
# Now we see the item we added.
curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true'
# Add another item to index.
curl -XPUT 'http://localhost:9200/twitter/tweet/2?pretty=true' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T17:12:12",
"message" : "Elastic Search rocks!"
}'
# See both items.
curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment