# 1KB JSON doc becomes 17KB after indexing with many fields of type "Keyword"

**URL:** <https://discuss.elastic.co/t/1kb-json-doc-becomes-17kb-after-indexing-with-many-fields-of-type-keyword/208720>\
**Category:** Elasticsearch\
**Created:** [November 20, 2019, 2:44pm UTC](https://discuss.elastic.co/t/1kb-json-doc-becomes-17kb-after-indexing-with-many-fields-of-type-keyword/208720 "2019-11-20T14:44:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madala](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@Madala](https://discuss.elastic.co/u/Madala)\
**Post date:** [November 20, 2019, 2:44pm UTC](https://discuss.elastic.co/t/1kb-json-doc-becomes-17kb-after-indexing-with-many-fields-of-type-keyword/208720/1 "2019-11-20T14:44:45Z")

</div>

Hi Team,

We are trying to do our Volume sizing exercise and found that a json doc of size 1KB is taking up about 17KB in the index. Our use case is metrics related and most of the fields do not need indexing for search. In our usecase, we will be getting a huge number of these docs on a daily basis. Please help us to reduce the size of each doc here.

ES Version : 7.4.1

our template :

{  
“analytics.program\_viewlog\_v1” : {  
“order” : 0,  
“index\_patterns” : [  
“analytics.program.viewlog.v1-\*”  
],  
“settings” : {  
“index” : {  
“number\_of\_shards” : “1",  
“refresh\_interval” : “5s”  
}  
},  
“mappings” : {  
“properties” : {  
“finalReport” : {  
“type” : “boolean”  
},  
“captionsEnabled” : {  
“type” : “boolean”  
},  
“sessionEndTime” : {  
“type” : “date”  
},  
“mayBeFinalReport” : {  
“type” : “boolean”  
},  
“viewlogId” : {  
“index” : false,  
“type” : “keyword”  
},  
“loginSessionId” : {  
“index” : false,  
“type” : “keyword”  
},  
“bitrate” : {  
“type” : “long”  
},  
“deliveryCorrelationId” : {  
“index” : false,  
“type” : “keyword”  
},  
“deliveryId” : {  
“index” : false,  
“type” : “keyword”  
},  
“playbackPosition” : {  
“type” : “double”  
},  
“uniqueWatchTime” : {  
“type” : “long”  
},  
“errorCount” : {  
“type” : “short”  
},  
“totalBufferTime” : {  
“type” : “long”  
},  
“deviceType” : {  
“type” : “keyword”  
},  
“watchedSecondsArray” : {  
“type” : “byte”  
},  
“audienceId” : {  
“index” : false,  
“type” : “keyword”  
},  
“totalPauseTime” : {  
“type” : “long”  
},  
“domainId” : {  
“index” : false,  
“type” : “keyword”  
},  
“bufferTime” : {  
“type” : “long”  
},  
“networkLocationId” : {  
“index” : false,  
“type” : “keyword”  
},  
“lastGenFinalPosition” : {  
“type” : “double”  
},  
“playbackPercentage” : {  
“type” : “double”  
},  
“playerState” : {  
“index” : false,  
“type” : “keyword”  
},  
“creationTime” : {  
“type” : “date”  
},  
“totalErrorCount” : {  
“type” : “short”  
},  
“contentId” : {  
“index” : false,  
“type” : “keyword”  
},  
“viewingSessionId” : {  
“index” : false,  
“type” : “keyword”  
},  
“browserType” : {  
“type” : “keyword”  
},  
“gen” : {  
“type” : “long”  
},  
“playbackRate” : {  
“type” : “double”  
},  
“avgBitRate” : {  
“type” : “long”  
},  
“osInfo” : {  
“type” : “keyword”  
},  
“assetId” : {  
“index” : false,  
“type” : “keyword”  
},  
“playerType” : {  
“index” : false,  
“type” : “keyword”  
},  
“totalBufferCount” : {  
“type” : “short”  
},  
“seq” : {  
“type” : “long”  
},  
“live” : {  
“type” : “boolean”  
},  
“channelId” : {  
“index” : false,  
“type” : “keyword”  
},  
“eventTimestamp” : {  
“type” : “date”  
},  
“clientId” : {  
“index” : false,  
“type” : “keyword”  
},  
“sessionStartTime” : {  
“type” : “date”  
},  
“userAgent” : {  
“index” : false,  
“type” : “keyword”  
},  
“userId” : {  
“index” : false,  
“type” : “keyword”  
},  
“embedLocation” : {  
“index” : false,  
“type” : “keyword”  
},  
“totalWatchTime” : {  
“type” : “long”  
},  
“bufferCount” : {  
“type” : “short”  
},  
“geoLocation” : {  
“type” : “nested”  
},  
“clientIp” : {  
“index” : false,  
“type” : “keyword”  
},  
“bcastInstanceId” : {  
“index” : false,  
“type” : “keyword”  
},  
“programId” : {  
“index” : false,  
“type” : “keyword”  
}  
}  
},  
“aliases” : { }  
}  
}

sample json being indexed  
POST analytics.program.viewlog.v1 - defaultdomain - 2017.01.02 / \_doc{  
“domainId”: “performancetest”,  
“eventTimestamp”: 1546281030000,  
“messageProducerId”: null,  
“messageSequence”: null,  
“viewlogId”: “144e1e1b - 25b6 - 487b - a568 - dbc4262dea62”,  
“creationTime”: 1546281030000,  
“programId”: “esc\_program: 1 ",“bcastInstanceId”:“esc\_program:1",  
“userId”: “USERID\_0 ",“viewingSessionId”:“188f380b\_viewingSessionId\_0\_1",  
“gen”: 1,  
“seq”: 0,  
“playerState”: “WAITING”,  
“playbackPosition”: 0,  
“bufferTime”: 12,  
“bufferCount”: 1,  
“loginSessionId”: “188f380b\_loginSessionId\_0\_1”,  
“clientIp”: null,  
“bitrate”: 177,  
“contentId”: “esc\_content: 1”,  
“assetId”: “esc\_cnt\_ast: 1”,  
“playerType”: “html5”,  
“deliveryId”: “dlvry\_akamai: 201”,  
“deliveryCorrelationId”: null,  
“audienceId”: “esc\_audience: 201 ",“clientId”:“esc\_client:1",  
“networkLocationId”: “esc\_networklocation: 1 ",“userAgent”:“Mozilla/5.0 (iPad; CPU OS 12\_1\_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",  
“lastGenFinalPosition”: 0,  
“embedLocation”: “VCC”,  
“channelId”: “esc\_prg\_cntr\_chn: 1”,  
“deviceType”: null,  
“browserType”: null,  
“osInfo”: null,  
“geoLocation”: null,  
“playbackPercentage”: 0.0,  
“playbackRate”: 1.0,  
“totalWatchTime”: 0,  
“uniqueWatchTime”: 0,  
“totalPauseTime”: 0,  
“totalBufferTime”: 491,  
“totalBufferCount”: 0,  
“totalErrorCount”: 0,  
“avgBitRate”: 177,  
“sessionStartTime”: 1546281000,  
“sessionEndTime”: 1573642787855,  
“mayBeFinalReport”: false,  
“watchedSecondsArray”: ,  
“contentDuration”: 1200000,  
“live”: false,  
“finalReport”: false,  
“captionsEnabled”: false  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 18, 2019, 2:44pm UTC](https://discuss.elastic.co/t/1kb-json-doc-becomes-17kb-after-indexing-with-many-fields-of-type-keyword/208720/2 "2019-12-18T14:44:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
