finalizing elasticsearch