示例#1
0
 public void TestMethod1()
 {
     IElasticClient clent   = EsHelper.CreateElasticClient();
     var            result  = clent.GetAlias(a => a.Name("vendorpromotionnews"));
     var            indices = result.Indices.Select(index => index.Key).Select(dummy => (IndexName)dummy).ToArray();
     var            s       = result;
 }
示例#2
0
 protected SynchronizerBase()
 {
     if (EsClient == null)
     {
         EsClient = EsHelper.CreateElasticClient();
     }
     _configs = IndexSyncConfigHelper.IndexSyncConfigs;
 }
示例#3
0
        static void Main(string[] args)
        {
            try
            {
                //依赖newtonsoft.json 10.0.1
                EsHelper.Init("192.168.0.168", 9200);

                //依赖newtonsoft.json 6.0.8
                Validate.ValidateTool.IsValid();

                //依赖newtonsoft.json 10.0.1
                EsHelper.Init("192.168.0.168", 9200);
            }
            catch (Exception ex)
            {
                Console.WriteLine("failure:");
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine("referance muti version assembly success");

            Console.ReadKey();
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="indexName">索引</param>
 /// <param name="log">日志</param>
 /// <param name="timeout">超时时间(毫秒)</param>
 public EsHandle(string indexName, ILog log, int timeout = 30000)
 {
     _log       = log;
     _indexName = indexName.ToLower();
     Client     = EsHelper.CreateElasticClient(indexName, timeout);
 }