public Mouth(Contexts.Destination destination) { _destination = destination; _client = new Nest.ElasticClient(new Nest.ConnectionSettings(new Uri(destination.Url))); }
private void EagerCreateIndex(Destination destination) { try { var index = _client.CreateIndex(destination.Index, new Nest.IndexSettings()); _indexCreated = true; if (destination.Mapping != null) { _client.MapFluent(m => { m.IndexName(destination.Index); m.TypeName(destination.Type); if (destination.Mapping.Parent != null) m.SetParent(destination.Mapping.Parent.Type); return m; }); } } catch (Exception ex) { log.Error(ex); throw; } }