Elastic search data format

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?

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

Hope this helps,

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 ?

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

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 :slight_smile:
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:


and here :

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

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 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.