Explorar o código

fix:ElasticSearch自动映射mapping

徐少年 %!s(int64=3) %!d(string=hai) anos
pai
achega
4011f04b0f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Admin.NET/Admin.NET.Core/Logging/ElasticSearchSetup.cs

+ 1 - 0
Admin.NET/Admin.NET.Core/Logging/ElasticSearchSetup.cs

@@ -20,6 +20,7 @@ public static class ElasticSearchSetup
         var connectionPool = new SniffingConnectionPool(uris);
         var settings = new ConnectionSettings(connectionPool).DefaultIndex(defaultIndex);
         var client = new ElasticClient(settings);
+        client.Indices.Create(defaultIndex, i => i.Map<SysLogOp>(m => m.AutoMap()));
 
         services.AddSingleton(client); // 单例注册
     }