Exemple #1
0
        public void GetAliases()
        {
            var sut     = new ElasticSearchConnector(config);
            var indices = sut.GetAliases().Result;

            Assert.IsTrue(indices.ToList().Count > 0);
        }
 public string[] GetTablePath()
 {
     if (_index != null)
     {
         var mappingTypes = new ElasticSearchConnector(this.Server.ConnectionInfo.ToConectorConfig()).GetMappingTypes(this._index).ToList();
         if (mappingTypes.Count > 1)
         {
             return new string[] { this.Server.Title, Title, mappingTypes.First() }
         }
         ;
     }
     return(new string[] { this.Server.Title, Title });
 }
 public string[] GetTableFields()
 {
     if (_index != null)
     {
         var mappingTypes = new ElasticSearchConnector(this.Server.ConnectionInfo.ToConectorConfig()).GetMappingTypes(this._index).ToList();
         var fields       = new ElasticSearchConnector(this.Server.ConnectionInfo.ToConectorConfig()).GetFields(this._index).ToList();
         if (mappingTypes.Count > 1)
         {
             return(fields.Where(x => x.MappingType == mappingTypes[0]).Select(x => x.Name).ToArray());
         }
         else
         {
             return(fields.Select(x => x.Name).ToArray());
         }
     }
     return(new string[0]);
 }