Thong Nguyen
Thong Nguyen

Reputation: 291

Is there any way to know how much disk space a indexed field take in Elasticsearch

I'm indexing a document with mapped fields defined, the disk size ended up too much and I want to inspect how much disk space each indexed fields take?

Is there any way to do it? Index stats here seems only display the overall for all fields (https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html)

{
    '_source': {
        'enabled': False,
    },
    'properties': {
        'ip': {
            'type': 'ip',
        },
        'timestamp': {
            'type': 'date',
        },
        'data': {
            'type': 'text',
        },
        ...
    }
}

Update index stats

curl -X GET "localhost:9200/_cat/allocation?v"
shards disk.indices disk.used disk.avail disk.total disk.percent host       ip         node
     3        6.3mb    28.3gb       30gb     58.4gb           48 172.17.0.3 172.17.0.3 57dac878cf46
     2                                                                                 UNASSIGNED

curl -X GET "localhost:9200/_cat/indices?v"
health status index                           uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   my-index                        vjdK1nkRRimxtdUvgKWNHA   1   1      10000            0      6.3mb          6.3mb
yellow open   .kibana                         kDM_5IpMQfacYN6F2_mxrQ   1   1          1            0        5kb            5kb

Upvotes: 0

Views: 447

Answers (1)

Val
Val

Reputation: 217274

The value of a given field might not be stored only once in a single place, there are many different underlying data structures in Lucene.

You can find more information in this thread which answers the same question: https://lucene.472066.n3.nabble.com/Get-size-occupied-by-each-field-in-lucene-index-td4347856.html

Upvotes: 1

Related Questions