Пример #1
0
 public void Initialize(NuGetSearchAppConfig config)
 {
     _nodeLocation = new Uri(config.ServerUri);
     _settings     = new ConnectionSettings(_nodeLocation)
                     .DefaultMappingFor <NuGetSearchMain>(m => m.IndexName(config.IndexName)
                                                          .IdProperty("Id"));
     _resolver  = new IndexNameResolver(_settings);
     _indexName = _resolver.Resolve <NuGetSearchMain>();
     _client    = new ElasticClient(_settings);
 }
Пример #2
0
 public HomeController(IOptions <NuGetSearchAppConfig> config, ISearchRepo repo)
 {
     _repo   = repo;
     _config = config.Value;
     _repo.Initialize(_config);
 }