added a big of code to create an index in es