// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IElasticSearchClientManager clientManager, IOptions <ElasticConfig> elasticConfig) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseMvc(); var index = elasticConfig.Value.IndexName; if (!clientManager.GetClient().IndexExists(index).Exists) { clientManager.GetClient().CreateIndex(index); } }
public ProductQueryServiceElastic(IElasticSearchClientManager clientManager) { _client = clientManager.GetClient(); }