Updated toElasticsearch for new core.Index syntax