I use Delete by Query API to delete old documents.
On the monitoring console, I can see the storage size of the index was not changed.
I can see the file for this index in DATA folder is still present.
If the index contains zero document, will be deleted or not ?
Delete just marks docs as deleted. It doesn't reclaim any space. Segment merging done automatically/periodically by Lucene reduces the disk usage. This is not the ideal way to retire old documents.
The best way to deal with expiring old documents is via time-based indices and index lifecycle management.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.