Calculate OpenSearch index size on disk from document count and field mappings.
OpenSearch and Elasticsearch store a primary copy of every document plus one full copy per configured replica, then apply codec-level compression to the stored segments: index_size = docs × avg_doc_size × (1 + replicas) ÷ compression_ratio. Because replicas are full data copies (not just checksums), replica count multiplies storage directly, while compression works against the combined primary+replica footprint.
index_size_GB = docs × avg_doc_size_KB × (1 + replicas) / compression_ratio / (1024 × 1024)
Each replica shard is a complete copy of its primary shard's data, kept in sync for search availability and resilience — so replica_count=1 doubles stored data, not just adds a small overhead.
The default codec typically achieves modest compression (~1.1-1.2×); switching to `best_compression` (which uses DEFLATE) commonly reaches 1.3-1.6× at some CPU and indexing-latency cost.
Yes — inverted indexes, doc values, and stored fields can add overhead beyond the raw JSON source, especially for heavily analyzed text fields; the avg_doc_size input should reflect actual observed index footprint per doc where possible, not just raw JSON size.
This calculator estimates total index size regardless of shard count; shard count instead determines how that total is distributed across primary shards, which affects query parallelism and per-shard resource usage.