I noticed a strange behavior in ElasticSearch (version 5.5.0) where store.size decreased while docs.count increased. Why does this happen?
$ curl 'localhost:9201/_cat/indices/index-name:2017-08-08?bytes=b&v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open index-name:2017-08-08 PlpLYu5vTN-HFA_ygHUNwg 17 1 5577181 212434 3827072602 1939889776
$ curl 'localhost:9201/_cat/indices/index-name:2017-08-08?bytes=b&v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open index-name:2017-08-08 PlpLYu5vTN-HFA_ygHUNwg 17 1 5581202 204815 3812410150 1927833617
Note that while docs.count increased from 5577181->5581202, both store.size and pri.store.size decreased.
For background, I'm trying to use index size to throttle data going into ES (i.e. xGB per day). However, what I notice is that as I continue indexing, the index size decreases periodically (every hour or minutes or so). This is then not a good way to throttle since the storage size isn't strictly increasing
1) Any idea why the index size decreases? 2) Is there another size I should use which is strictly increasing?
EDIT: Actually even when there are no deleted documents the doc count still decreases. See below
$ curl -s localhost:9200/_cat/indices | grep name green open index-name:2017-08-11
eIGiDgeZQ5CqSu3tAaLRgw 1 1 111717 0 210.4mb 109.5mb $ curl -s localhost:9200/_cat/indices | grep name green open index-name:2017-08-11
eIGiDgeZQ5CqSu3tAaLRgw 1 1 132329 0 204.7mb 103.2mb