示例#1
0
 public Health(
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _settings         = settings;
     _httpClientHelper = httpClientHelper;
 }
示例#2
0
        private static HttpClient SetupClient()
        {
            var client = MessageHandler.Handler != null
                ? new HttpClient(MessageHandler.Handler)
                : new HttpClient();

            IElasticSearchSettings settings = ServiceLocator.Current.GetInstance <IElasticSearchSettings>();

            if (!String.IsNullOrEmpty(settings.Username) &&
                !String.IsNullOrEmpty(settings.Password))
            {
                var credentials = Encoding.ASCII.GetBytes(
                    String.Concat(settings.Username, ":", settings.Password));

                client.DefaultRequestHeaders.Authorization =
                    new AuthenticationHeaderValue("Basic", Convert.ToBase64String(credentials));
            }
            else
            {
                client.DefaultRequestHeaders.Authorization = null;
            }

            if (settings.ClientTimeoutSeconds > 0)
            {
                client.Timeout = TimeSpan.FromSeconds(settings.ClientTimeoutSeconds);
            }

            return(client);
        }
 public ControllerStub(
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper,
     ILanguageBranchRepository languageBranchRepository)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
 }
示例#4
0
 public InspectorRepository(IElasticSearchSettings settings, IHttpClientHelper httpClientHelper, IContentTypeRepository contentTypeRepository)
 {
     _elasticSearchSettings = settings;
     _contentTypeRepository = contentTypeRepository;
     _httpClientHelper      = httpClientHelper;
     _mapping = new Mapping(settings, httpClientHelper);
 }
 public MappingValidatorService(IServerInfoService serverInfoService, IElasticSearchSettings elasticSearchSettings, IHttpClientHelper httpClientHelper)
 {
     _serverInfoService     = serverInfoService;
     _elasticSearchSettings = elasticSearchSettings;
     _httpClientHelper      = httpClientHelper;
     _mapping = new Mapping(_serverInfoService, _elasticSearchSettings, _httpClientHelper);
 }
示例#6
0
 public ElasticSearchService(
     IServerInfoService serverInfoService,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(serverInfoService, settings, httpClientHelper)
 {
 }
 public ElasticAutoSuggestController(
     ILanguageBranchRepository languageBranchRepository,
     IAutoSuggestRepository autoSuggestRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper) : base(settings, httpClientHelper, languageBranchRepository)
 {
     _autoSuggestRepository = autoSuggestRepository;
 }
示例#8
0
 public ElasticBoostingController(
     IContentLoader contentLoader,
     IBoostingRepository boostingRepository,
     IContentTypeRepository pageTypeRepository,
     IElasticSearchSettings elasticSearchSettings)
 {
     _boostingRepository = boostingRepository;
     _pageTypeRepository = pageTypeRepository;
 }
 public ElasticIndexInspectorController(
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper,
     IInspectorRepository inspectorRepository,
     ILanguageBranchRepository languageBranchRepository)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _inspectorRepository = inspectorRepository;
 }
示例#10
0
 public Indexing(
     IServerInfoService serverInfoService,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _serverInfoService = serverInfoService;
     _settings          = settings;
     _httpClientHelper  = httpClientHelper;
 }
示例#11
0
 internal SearchEngine(
     IServerInfoService serverInfoService,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _settings         = settings;
     _httpClientHelper = httpClientHelper;
     _serverInfo       = serverInfoService.GetInfo();
 }
示例#12
0
 public ElasticTrackingController(
     ILanguageBranchRepository languageBranchRepository,
     ITrackingRepository trackingRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _trackingRepository = trackingRepository;
 }
 public ElasticConsoleController(
     ILanguageBranchRepository languageBranchRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _settings         = settings;
     _httpClientHelper = httpClientHelper;
 }
示例#14
0
        private static string GetHost()
        {
            if (_settings == null)
            {
                _settings = ServiceLocator.Current.GetInstance <IElasticSearchSettings>();
            }

            return(_settings.Host);
        }
 public QueryBuilder(
     IServerInfoService serverInfoService,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _settings = settings;
     _mapping  = new Mapping(serverInfoService, settings, httpClientHelper);
     ServiceLocator.Current?.TryGetExistingInstance(out _boostingRepository);
 }
示例#16
0
 public ElasticSynonymsController(
     ILanguageBranchRepository languageBranchRepository,
     ISynonymRepository synonymRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _synonymRepository = synonymRepository;
 }
示例#17
0
 public ElasticAdminController(
     ILanguageBranchRepository languageBranchRepository,
     ICoreIndexer coreIndexer,
     IElasticSearchSettings settings)
 {
     _languageBranchRepository = languageBranchRepository;
     _coreIndexer  = coreIndexer;
     _settings     = settings;
     _healthHelper = new Health(settings);
 }
示例#18
0
        public Index(IElasticSearchSettings settings, string name) : this(settings)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new InvalidOperationException("'name' can not be empty.");
            }

            _name     = name.ToLower();
            _language = _name.Split('-').Last();
        }
示例#19
0
 public ElasticSynonymsController(
     ISynonymRepository synonymRepository,
     ILanguageBranchRepository languageBranchRepository,
     IElasticSearchSettings settings)
     : this(
         synonymRepository,
         languageBranchRepository,
         new Admin.Index(settings))
 {
 }
示例#20
0
 public CoreIndexer(
     IServerInfoService serverInfoService,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _serverInfoService = serverInfoService;
     _settings          = settings;
     _httpClientHelper  = httpClientHelper;
     _mapping           = new Mapping(serverInfoService, settings, httpClientHelper);
     _serverInfo        = serverInfoService.GetInfo();
 }
 public SynonymRepository(
     IContentRepository contentRepository,
     IBlobFactory blobFactory,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
 {
     _contentRepository = contentRepository;
     _blobFactory       = blobFactory;
     _settings          = settings;
     _httpClientHelper  = httpClientHelper;
 }
 public ElasticBoostingController(
     ILanguageBranchRepository languageBranchRepository,
     IBoostingRepository boostingRepository,
     IContentTypeRepository pageTypeRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _boostingRepository = boostingRepository;
     _pageTypeRepository = pageTypeRepository;
 }
 public ElasticBestBetsController(
     IContentLoader contentLoader,
     IBestBetsRepository bestBetsRepository,
     ILanguageBranchRepository languageBranchRepository,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _contentLoader      = contentLoader;
     _bestBetsRepository = bestBetsRepository;
 }
 public SynonymRepository(
     IContentLoader contentLoader,
     IContentRepository contentRepository,
     IBlobFactory blobFactory,
     IElasticSearchSettings settings)
 {
     _contentLoader     = contentLoader;
     _contentRepository = contentRepository;
     _blobFactory       = blobFactory;
     _settings          = settings;
 }
 public ElasticAdminController(
     ILanguageBranchRepository languageBranchRepository,
     ICoreIndexer coreIndexer,
     IElasticSearchSettings settings,
     IHttpClientHelper httpClientHelper)
     : base(settings, httpClientHelper, languageBranchRepository)
 {
     _coreIndexer      = coreIndexer;
     _settings         = settings;
     _healthHelper     = new Health(settings, httpClientHelper);
     _httpClientHelper = httpClientHelper;
 }
        protected ElasticSearchControllerBase(
            IElasticSearchSettings settings,
            IHttpClientHelper httpClientHelper,
            ILanguageBranchRepository languageBranchRepository)
        {
            _settings                 = settings;
            _httpClientHelper         = httpClientHelper;
            _languageBranchRepository = languageBranchRepository;

            Indices   = GetIndices();
            Languages = GetLanguages();
        }
 public ElasticTrackingController(
     IContentLoader contentLoader,
     ILanguageBranchRepository languageBranchRepository,
     ITrackingRepository trackingRepository,
     IElasticSearchSettings settings)
     : this(
         contentLoader,
         languageBranchRepository,
         trackingRepository,
         new Admin.Index(settings))
 {
 }
 public InspectorRepository(
     IElasticSearchSettings settings,
     IServerInfoService serverInfoService,
     IHttpClientHelper httpClientHelper,
     IContentTypeRepository contentTypeRepository)
 {
     _elasticSearchSettings = settings;
     _contentTypeRepository = contentTypeRepository;
     _httpClientHelper      = httpClientHelper;
     _mapping    = new Mapping(serverInfoService, settings, httpClientHelper);
     _serverInfo = serverInfoService.GetInfo();
 }
示例#29
0
 public Indexer(
     ICoreIndexer coreIndexer,
     IElasticSearchSettings elasticSearchSettings,
     ISiteDefinitionRepository siteDefinitionRepository,
     IContentLoader contentLoader,
     ContentAssetHelper contentAssetHelper)
 {
     _coreIndexer              = coreIndexer;
     _elasticSearchSettings    = elasticSearchSettings;
     _siteDefinitionRepository = siteDefinitionRepository;
     _contentLoader            = contentLoader;
     _contentAssetHelper       = contentAssetHelper;
 }
示例#30
0
 public BestBetsRepository(
     IElasticSearchSettings settings,
     IContentRepository contentRepository,
     UrlResolver urlResolver,
     IBlobFactory blobFactory,
     ICoreIndexer coreIndexer)
 {
     _settings          = settings;
     _contentRepository = contentRepository;
     _urlResolver       = urlResolver;
     _blobFactory       = blobFactory;
     _coreIndexer       = coreIndexer;
 }