# Best way to build a document with a fixed part and a variable part

**URL:** <https://discuss.elastic.co/t/best-way-to-build-a-document-with-a-fixed-part-and-a-variable-part/172482>\
**Category:** Elasticsearch\
**Created:** [March 15, 2019, 8:28am UTC](https://discuss.elastic.co/t/best-way-to-build-a-document-with-a-fixed-part-and-a-variable-part/172482 "2019-03-15T08:28:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastienf](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sebastienf](https://discuss.elastic.co/u/sebastienf)\
**Post date:** [March 15, 2019, 8:28am UTC](https://discuss.elastic.co/t/best-way-to-build-a-document-with-a-fixed-part-and-a-variable-part/172482/1 "2019-03-15T08:28:58Z")

</div>

Hi Everyone,

I aim to ingest datas in ES documents.

My datas are pretty much like this ::  
fixed\_field1;fixed\_field2;...;variable\_field1;variable\_field2;...

And then, I want to build ES documents like this ::  
{  
"fixed\_field1\_label":"fixed\_field1",  
"fixed\_field2\_label":"fixed\_field2",  
...,  
"variable\_field1\_label":"variable\_field1",  
"variable\_field2\_label":"variable\_field2",  
...  
}

The fixed part is very very common whereas the variable part is very unique.

I was wondering, in order to save space storage, if there was an approach to externalize the fixed part ? I saw things such as "nested" or "has\_child" or "has\_parent", but I fear that this make impossible querying throught Kibana or Grafana. Indeed, my documents must be readable by those kind of tools...

Thanks for your help 🙂

---

<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:** [April 12, 2019, 8:29am UTC](https://discuss.elastic.co/t/best-way-to-build-a-document-with-a-fixed-part-and-a-variable-part/172482/2 "2019-04-12T08:29:30Z")

</div>

Closed on April 12, 2019, 8:29am UTC

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