Update Elastic Search Indices as well as schema toJSON

Updates and fixes to the code. Added more tests.