Here is the index statistics.
Avinashs-MacBook-Pro:~ avinashpandey$ curl 'localhost:9200/_cat/indices?v'
health status index pri rep docs.count **docs.deleted** store.size pri.store.size
yellow open sitemonitor-5min 5 1 8151707 **221036** 1.2gb 1.2gb
I am sure I have only been doing HTTP Post at /index/type/_id and have not deleted a single document. Where do these deleted docs come from then?
Deleting an index deletes its documents, shards, and metadata. It does not delete related Kibana components, such as data views, visualizations, or dashboards.
Yes, deleting the index, deletes all the data in that index.
Elasticsearch will get significant slower if you just add some big number as size, one method to use to get all documents is using scan and scroll ids. The results from this would contain a _scroll_id which you have to query to get the next 100 chunk. This answer needs more updates. search_type=scan is now deprecated.
To delete all indices, use _all or * . To disallow the deletion of indices with _all or wildcard expressions, set the action. destructive_requires_name cluster setting to true .
A overwrite ( An index operation on existing document ) or an update operation also does delete in background.
Due to immutability of segments in Lucene index , deletion operation is not exactly possible easily. For any change to the original document operation , like reindex or update , it needs to delete the document , mark it as deleted and create a new document with the change , in the background.
You are seeing this delete because you might have used UPDATE API or written a document to a doc ID which already exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With