Fix elasticsearch api call.