add json written as files into a dir and indexing in elasticsearch