Пример #1
0
 public Index(IndexConfiguration IndexConfiguration, Dictionary<string, FieldProperties> Fields, string IndexName, bool Online, ShardConfiguration ShardConfiguration) : this() {
   this.IndexConfiguration = IndexConfiguration;
   this.Fields = Fields;
   this.IndexName = IndexName;
   this.Online = Online;
   this.ShardConfiguration = ShardConfiguration;
 }
Пример #2
0
 public void Read (TProtocol iprot)
 {
   bool isset_IndexConfiguration = false;
   bool isset_Fields = false;
   bool isset_IndexName = false;
   bool isset_Online = false;
   bool isset_ShardConfiguration = false;
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Map) {
           {
             Analyzers = new Dictionary<string, AnalyzerProperties>();
             TMap _map36 = iprot.ReadMapBegin();
             for( int _i37 = 0; _i37 < _map36.Count; ++_i37)
             {
               string _key38;
               AnalyzerProperties _val39;
               _key38 = iprot.ReadString();
               _val39 = new AnalyzerProperties();
               _val39.Read(iprot);
               Analyzers[_key38] = _val39;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           IndexConfiguration = new IndexConfiguration();
           IndexConfiguration.Read(iprot);
           isset_IndexConfiguration = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Map) {
           {
             Fields = new Dictionary<string, FieldProperties>();
             TMap _map40 = iprot.ReadMapBegin();
             for( int _i41 = 0; _i41 < _map40.Count; ++_i41)
             {
               string _key42;
               FieldProperties _val43;
               _key42 = iprot.ReadString();
               _val43 = new FieldProperties();
               _val43.Read(iprot);
               Fields[_key42] = _val43;
             }
             iprot.ReadMapEnd();
           }
           isset_Fields = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.String) {
           IndexName = iprot.ReadString();
           isset_IndexName = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.Bool) {
           Online = iprot.ReadBool();
           isset_Online = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.Map) {
           {
             Scripts = new Dictionary<string, ScriptProperties>();
             TMap _map44 = iprot.ReadMapBegin();
             for( int _i45 = 0; _i45 < _map44.Count; ++_i45)
             {
               string _key46;
               ScriptProperties _val47;
               _key46 = iprot.ReadString();
               _val47 = new ScriptProperties();
               _val47.Read(iprot);
               Scripts[_key46] = _val47;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.Map) {
           {
             SearchProfiles = new Dictionary<string, SearchQuery>();
             TMap _map48 = iprot.ReadMapBegin();
             for( int _i49 = 0; _i49 < _map48.Count; ++_i49)
             {
               string _key50;
               SearchQuery _val51;
               _key50 = iprot.ReadString();
               _val51 = new SearchQuery();
               _val51.Read(iprot);
               SearchProfiles[_key50] = _val51;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.Struct) {
           ShardConfiguration = new ShardConfiguration();
           ShardConfiguration.Read(iprot);
           isset_ShardConfiguration = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_IndexConfiguration)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_Fields)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_IndexName)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_Online)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_ShardConfiguration)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }
Пример #3
0
 public Index() {
   this._Analyzers = new Dictionary<string, AnalyzerProperties>();
   this.__isset.Analyzers = true;
   this.IndexConfiguration = new IndexConfiguration();
   this.Fields = new Dictionary<string, FieldProperties>();
   this.Online = false;
   this._Scripts = new Dictionary<string, ScriptProperties>();
   this.__isset.Scripts = true;
   this._SearchProfiles = new Dictionary<string, SearchQuery>();
   this.__isset.SearchProfiles = true;
   this.ShardConfiguration = new ShardConfiguration();
 }