# Elastic search data format

**URL:** <https://discuss.elastic.co/t/elastic-search-data-format/59552>\
**Category:** Elasticsearch\
**Created:** [September 1, 2016, 1:12pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552 "2016-09-01T13:12:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Masternoy](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@Igor\_Masternoy](https://discuss.elastic.co/u/Igor_Masternoy)\
**Post date:** [September 1, 2016, 1:12pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/1 "2016-09-01T13:12:18Z")

</div>

As I we know elastic search based on Apache Lucene and store it's data in Lucene's indexes in binary format. Is there any way to save the raw json data?

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [September 1, 2016, 2:06pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/2 "2016-09-01T14:06:37Z")

</div>

Can you elaborate why you want to do that?

I think what you want to look at is the \_source field for your documents: [https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping-source-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping-source-field.html)

Hope this helps,  
Isabel

---

<div class="post-metadata">

**Author:** ![Igor\_Masternoy](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@Igor\_Masternoy](https://discuss.elastic.co/u/Igor_Masternoy)\
**Post date:** [September 1, 2016, 2:50pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/3 "2016-09-01T14:50:58Z")

</div>

Thank you for your reply! Can we somehow export Elastic data to a json file without querying to ES. Do you know is there any place where ES store raw files not binary Lucene indices ?

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [September 1, 2016, 3:33pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/4 "2016-09-01T15:33:58Z")

</div>

Can you explain why you want to do that? E.g. can't you just use the original documents you used for indexing?

---

<div class="post-metadata">

**Author:** ![Igor\_Masternoy](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@Igor\_Masternoy](https://discuss.elastic.co/u/Igor_Masternoy)\
**Post date:** [September 1, 2016, 3:56pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/5 "2016-09-01T15:56:08Z")

</div>

What if don't have this document physically e.g. I added some info to ES via PUT request. Of course I can save this document, that has been added by PUT request to some file in the system AND to the ES, but with such approach I will need to manually check consistency of the file with my documents and it's impossible and leads to rewriting ES 🙂  
But  
I think I found the way to do this! For sure it can slow down ES or it's possible that it will require more space, but It's very interesting, it's described here:

[http://blog.florian-hopf.de/2012/12/looking-at-plaintext-lucene-index.html](http://blog.florian-hopf.de/2012/12/looking-at-plaintext-lucene-index.html)

and here :

> **[Build Your Own Lucene Codec!](http://opensourceconnections.com/blog/2013/06/05/build-your-own-lucene-codec/)**
>
> I’ve been having a lot of fun hacking on a Lucene Codec lately. My hope is to create a Lucene storage layer based on FoundationDB – a new distributed and tra...

What do you think about rewriting Lucene codec?  
Anyway, Thank you for your replies.

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [September 5, 2016, 11:30am UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/6 "2016-09-05T11:30:09Z")

</div>

> [@Igor\_Masternoy](#):
>
> What if don't have this document physically e.g. I added some info to ES via PUT request.

Great you found a solution for your question - and thank you for posting it here so others benefit.

You seem to be using Elasticsearch as primary data store. Please make sure to check out [Elasticsearch Resiliency Status | Elastic](https://www.elastic.co/guide/en/elasticsearch/resiliency/current/index.html#_data_store_recommendations) if you haven't done so already so you are fully aware of the implications.

Isabel

---

<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:** [July 5, 2017, 10:22pm UTC](https://discuss.elastic.co/t/elastic-search-data-format/59552/7 "2017-07-05T22:22:29Z")

</div>


