Skip to content

Instantly share code, notes, and snippets.

@radu-gheorghe
Created April 14, 2014 10:50
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 radu-gheorghe/10637236 to your computer and use it in GitHub Desktop.
Save radu-gheorghe/10637236 to your computer and use it in GitHub Desktop.
deleted stats are not updated when running delete by query in Elasticsearch 1.1.0
#!/bin/sh
echo
echo '==========================='
echo 'Creating an empty index'
echo '==========================='
curl -XDELETE localhost:9200/test
curl -XPOST localhost:9200/test/ -d '{"settings": {"index.number_of_shards": 1}}'
echo
echo '==========================='
echo 'Index a document and delete it by ID'
echo '==========================='
curl localhost:9200/test/test/1 -d '{"foo":"bar"}'
curl -XDELETE localhost:9200/test/test/1
echo
echo '==========================='
echo 'Stats are updated'
echo '==========================='
curl -s 'http://localhost:9200/_stats?indexing=true&pretty' | grep 'delete_' | head -3
echo
echo '==========================='
echo 'Index a document and delete it by query'
echo '==========================='
curl localhost:9200/test/test/1 -d '{"foo":"bar"}'
curl -XDELETE localhost:9200/test/_query?q=*:*
echo
echo '==========================='
echo 'BUG! Stats are NOT updated'
echo '==========================='
curl -s 'http://localhost:9200/_stats?indexing=true&pretty' | grep 'delete_' | head -3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment