Exemple #1
0
 public Mouth(Contexts.Destination destination)
 {
     _destination = destination;
     _client = new Nest.ElasticClient(new Nest.ConnectionSettings(new Uri(destination.Url)));
 }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
 public Mouth(Contexts.Destination destination)
 {
     _destination = destination;
     _client      = new Nest.ElasticClient(new Nest.ConnectionSettings(new Uri(destination.Url)));
 }