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