Flatten nested JSON using jq
<p>I'd like to flatten a nested json object,  e.g. <code>{"a":{"b":1}}</code> to <code>{"a.b":1}</code> in order to digest it in solr.</p>

<p>I have 11 TB of json files which are both nested and contains dots in field names, meaning not elasticsearch (dots) nor solr (nested without the <code>_childDocument_</code> notation) can digest it as is.</p>

<p>The other solutions would be to replace dots in the field names with underscores and push it to elasticsearch, but I have far better experience with solr therefore I prefer the flatten solution (unless solr can digest those nested jsons as is??). </p>

<p>I will prefer elasticsearch only if the digestion process will take far less time than solr, because my priority is digesting as fast as I can (thus I chose jq instead of scripting it in python). </p>

<p>Kindly help. </p>

<p>EDIT:</p>

<p>I think the pair of examples 3&amp;4 solves this for me:
<a href="https://lucidworks.com/blog/2014/08/12/indexing-custom-json-data/" rel="noreferrer">https://lucidworks.com/blog/2014/08/12/indexing-custom-json-data/</a></p>

<p>I'll try soon.</p>