Preserve directories when generating es data.

 - when dealing with more than 100k, directory structure needs
 to be preserved, in order to avoid exceeding the file limit per
 directory.