# Elasticsearch json representation for metadata and content

**URL:** https://discuss.elastic.co/t/elasticsearch-json-representation-for-metadata-and-content/215073
**Category:** Elasticsearch
**Created:** [January 15, 2020, 4:42am UTC](https://discuss.elastic.co/t/elasticsearch-json-representation-for-metadata-and-content/215073 "2020-01-15T04:42:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Abhinav\_Gandhi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhinav_gandhi/32/60794_2.png) [@Abhinav\_Gandhi](https://discuss.elastic.co/u/Abhinav_Gandhi)
#### Post date: [January 15, 2020, 4:42am UTC](https://discuss.elastic.co/t/elasticsearch-json-representation-for-metadata-and-content/215073/1 "2020-01-15T04:42:33Z")

</div>

Each document json information has **metadata** (status, type, name, description, size ) and the article **content** itself.  
Metadata is of smaller size around 20KB. And article content is of larger size, it may range anywhere from 100KB to 100Mb. Content will not be updated however metadata information is updated (max 5-6 times in its lifetime)  
We need to to search the content and metadata together and since elastic search mentions keeping - _ **A single document should contain all of the information that is required to decide whether it matches a search request.** _

So I want to know how to document this piece.

But there are several approaches -

1. Should we keep the metadata and content together, considering the extract from how updates work in elastic search  
**Consequently, updating a previously indexed document is a delete followed by a re-insertion of the document. Note that this means that updating a document is even more expensive than adding it in the first place. Thus, storing things like rapidly changing counters in a Lucene index is usually not a good idea – there is no in-place update of values.**
2. Also since the content size can range from kbs to mbs, should we keep the entire content or should we split it into smaller segments and keep.

Are there any more approaches generally followed for this requirement ?

---

<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: [February 12, 2020, 4:55am UTC](https://discuss.elastic.co/t/elasticsearch-json-representation-for-metadata-and-content/215073/2 "2020-02-12T04:55:33Z")

</div>

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