public ExternalSearchService(IAppConfiguration config, IDiagnosticsService diagnostics, ISearchClient searchClient)
        {
            _searchClient = searchClient ?? throw new ArgumentNullException(nameof(searchClient));

            Trace = diagnostics.SafeGetSource("ExternalSearchService");
        }
Example #2
0
        public Server(IIOService ioService, IViewClient viewClient, IQueryClient queryClient, IQueryClient streamingQueryClient, ISearchClient searchClient,
                      INodeAdapter nodeAdapter,
                      ClientConfiguration clientConfiguration, ITypeTranscoder transcoder, IBucketConfig bucketConfig)
        {
            if (ioService != null)
            {
                _ioService = ioService;
                _ioService.ConnectionPool.Owner = this;
            }
            _nodeAdapter         = nodeAdapter;
            _clientConfiguration = clientConfiguration;
            _bucketConfiguration = clientConfiguration.BucketConfigs[bucketConfig.Name];
            _timingEnabled       = _clientConfiguration.EnableOperationTiming;
            _typeTranscoder      = transcoder;
            _bucketConfig        = bucketConfig;

            //services that this node is responsible for
            IsMgmtNode   = _nodeAdapter.MgmtApi > 0;
            IsDataNode   = _nodeAdapter.KeyValue > 0;
            IsQueryNode  = _nodeAdapter.N1QL > 0;
            IsIndexNode  = _nodeAdapter.IndexAdmin > 0;
            IsViewNode   = _nodeAdapter.Views > 0;
            IsSearchNode = _nodeAdapter.IsSearchNode;

            //View and query clients
            ViewClient            = viewClient;
            QueryClient           = queryClient;
            SearchClient          = searchClient;
            _streamingQueryClient = streamingQueryClient;

            CachedViewBaseUri  = UrlUtil.GetViewBaseUri(_nodeAdapter, _bucketConfiguration);
            CachedQueryBaseUri = UrlUtil.GetN1QLBaseUri(_nodeAdapter, _bucketConfiguration);

            if (IsDataNode || IsQueryNode)
            {
                _lastIOErrorCheckedTime = DateTime.Now;

                //On initialization, data nodes are authenticated, so they can start in a down state.
                //If the node is down immediately start the timer, otherwise disable it.
                if (IsDataNode)
                {
                    _isDown = _ioService.ConnectionPool.InitializationFailed;
                }

                Log.InfoFormat("Initialization {0} for node {1}", _isDown ? "failed" : "succeeded", EndPoint);

                //timer and node status
                _heartBeatTimer = new Timer(_heartBeatTimer_Elapsed, null, Timeout.Infinite, Timeout.Infinite);
                if (_isDown)
                {
                    StartHeartbeatTimer();
                }
            }
        }
Example #3
0
 public SearchManager(ISearchClient client)
 {
     Client = client
              ?? throw new ArgumentNullException(nameof(client));
 }
Example #4
0
 public YahooSearchService(ISearchClient searchClient)
 {
     _searchClient = searchClient;
 }
Example #5
0
 public ArchimedesSearchDialog(ISearchClient searchClient) : base(searchClient, multipleSelection: true)
 {
 }
Example #6
0
 public SearchController(ISearchClient searchClient)
 {
     _searchClient = searchClient;
 }
Example #7
0
 public SearchService(ISearchClient iSearchClient)
 {
     _iSearchClient = iSearchClient;
 }
 public BooksController(IDatabaseClient databaseClient, ISearchClient searchClient)
 {
     this.databaseClient = databaseClient;
     this.searchClient = searchClient;
 }
Example #9
0
 public SearchManager(ISearchClient searchClient, ILoggerFactory loggerFactory)
 {
     _searchClient = searchClient;
     _logger       = loggerFactory.GetLoggerForType <SearchManager>();
 }
Example #10
0
 public SearchClient(string authorizationHeader, ClientConfiguration.ClientAdapter clientadapter = ClientConfiguration.ClientAdapter.Proxy)
 {
     _client = ClientAdapterFactory2.GetInstance <ISearchClient>(this.GetType(), authorizationHeader, clientadapter: clientadapter);
 }
Example #11
0
 public SearchClient(string authorizationHeader, IConfigProvider configProvider)
 {
     _client = ClientAdapterFactory2.GetInstance <ISearchClient>(this.GetType(), authorizationHeader, configProvider);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="srchConnectionString"></param>
 /// <param name="provider"></param>
 public QuerySuggester(string srchConnectionString)
 {
     SrchClient = new LuceneClient <QuerySuggesterDocument>(srchConnectionString);
 }
Example #13
0
 /// <summary>
 /// Initialises with the Bing search client.
 /// </summary>
 /// <param name="searchClient"></param>
 public ImageController(ISearchClient searchClient)
 {
     _searchClient = searchClient;
 }
 internal static EndpointDiagnostics CreateEndpointHealth(string bucketName, DateTime createdAt, ISearchClient client, EndPoint endPoint)
 {
     return(new EndpointDiagnostics
     {
         Type = ServiceType.Search,
         LastActivity = CalculateLastActivity(createdAt, client.LastActivity),
         Remote = endPoint?.ToString() ?? UnknownEndpointValue,
         State = client.LastActivity.HasValue ? ServiceState.Connected : ServiceState.New,
         Scope = bucketName
     });
 }
        public SearchViewModel(ISearchClient searchClient)
        {
            this.searchClient = searchClient;

            SearchResults = new ObservableCollection <SearchResults>();
        }
 public TestController(ISearchClient client)
 {
     _client = client;
 }
Example #17
0
        public ObservableSearchClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Search;
        }
Example #18
0
 public void Setup()
 {
     _searchClient = new SearchClient(_client);
 }
Example #19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="srchClient"></param>
 public QuerySuggester(ISearchClient <QuerySuggesterDocument> srchClient)
 {
     SrchClient = srchClient;
 }
 public SearchService(ISearchClient searchClient, INightcrawlerClient nightcrawlerClient)
 {
     _searchClient       = searchClient;
     _nightcrawlerClient = nightcrawlerClient;
 }
        public Server(IIOService ioService, IViewClient viewClient, IViewClient streamingViewClient, IQueryClient queryClient, IQueryClient streamingQueryClient, ISearchClient searchClient,
                      IAnalyticsClient analyticsClient, INodeAdapter nodeAdapter, ITypeTranscoder transcoder, ConfigContextBase context)
        {
            if (ioService != null)
            {
                _ioService = ioService;
                _ioService.ConnectionPool.Owner = this;
            }

            _clientConfiguration = context.ClientConfig;
            _bucketConfiguration = context.ClientConfig.BucketConfigs[context.BucketConfig.Name];
            _timingEnabled       = _clientConfiguration.EnableOperationTiming;
            _typeTranscoder      = transcoder;

            //set all properties based off the nodes and nodeExt adapter
            LoadNodeAdapter(nodeAdapter, context.BucketConfig.Rev);

            //View and query clients
            ViewClient            = viewClient;
            _streamingViewClient  = streamingViewClient;
            QueryClient           = queryClient;
            SearchClient          = searchClient;
            _streamingQueryClient = streamingQueryClient;
            AnalyticsClient       = analyticsClient;

            if (IsDataNode || IsQueryNode)
            {
                _lastIOErrorCheckedTime = DateTime.Now;

                //On initialization, data nodes are authenticated, so they can start in a down state.
                //If the node is down immediately start the timer, otherwise disable it.
                if (IsDataNode)
                {
                    _isDown = _ioService.ConnectionPool.InitializationFailed;
                }

                Log.Info("Initialization {0} for node {1}", _isDown ? "failed" : "succeeded", EndPoint);

                //timer and node status
                _heartBeatTimer = new Timer(_heartBeatTimer_Elapsed, null, Timeout.Infinite, Timeout.Infinite);
                if (_isDown)
                {
                    StartHeartbeatTimer();
                }
            }
        }
Example #22
0
 public JobsDialog(ISearchClient searchClient, SearchQueryBuilder queryBuilder) : base(searchClient, queryBuilder, new JobStyler(), multipleSelection: true)
 {
 }
Example #23
0
 public Search(Database.Tables.SearchItem item, ApplicationUser owner)
 {
     this.Searchitem = item;
     _searchClient   = ResolveSearchClient(Searchitem.Url);
     this._user      = owner;
 }
        /// <summary>
        /// Creates a <see cref="GitHubRepoIssueReaderWriter"/> object. This object is used to interface with GitHub to manage issues that are being migrated.
        /// </summary>
        public GitHubRepoIssueReaderWriter(string repoOwner, string repo, IIssuesClient issues, ISearchClient search)
        {
            ArgValidate.IsNotNullNotEmptyNotWhiteSpace(repoOwner, nameof(repoOwner));
            ArgValidate.IsNotNullNotEmptyNotWhiteSpace(repo, nameof(repo));
            ArgValidate.IsNotNull(issues, nameof(issues));
            ArgValidate.IsNotNull(search, nameof(search));

            this.repoOwner = repoOwner;
            this.repo      = repo;
            this.issues    = issues;
            this.search    = search;
        }
Example #25
0
        public ExternalSearchService(IAppConfiguration config, IDiagnosticsService diagnostics, ISearchClient searchClient, IFeatureFlagService featureFlagService)
        {
            ServiceUri          = config.ServiceDiscoveryUri;
            _searchClient       = searchClient ?? throw new ArgumentNullException(nameof(searchClient));
            _featureFlagService = featureFlagService ?? throw new ArgumentNullException(nameof(featureFlagService));

            Trace = diagnostics.SafeGetSource("ExternalSearchService");

            // Extract credentials
            var          userInfo    = ServiceUri.UserInfo;
            ICredentials credentials = null;

            if (!String.IsNullOrEmpty(userInfo))
            {
                var split = userInfo.Split(':');
                if (split.Length != 2)
                {
                    throw new FormatException("Invalid user info in SearchServiceUri!");
                }

                // Split the credentials out
                credentials = new NetworkCredential(split[0], split[1]);
                ServiceUri  = new UriBuilder(ServiceUri)
                {
                    UserName = null,
                    Password = null
                }.Uri;
            }

            // note: intentionally not locking the next two assignments to avoid blocking calls
            if (_healthIndicatorStore == null)
            {
                _healthIndicatorStore = new BaseUrlHealthIndicatorStore(new AppInsightsHealthIndicatorLogger());
            }

            if (_deprecatedSearchClient == null)
            {
                _deprecatedSearchClient = new SearchClient(
                    ServiceUri,
                    config.SearchServiceResourceType,
                    credentials,
                    _healthIndicatorStore,
                    QuietLog.LogHandledException,
                    new TracingHttpHandler(Trace),
                    new CorrelatingHttpClientHandler());
            }
        }
Example #26
0
 public DataService(ISearchClient searchClient)
 {
     _searchClient = searchClient;
 }
Example #27
0
 public GoogleSearchService(ISearchClient searchClient)
 {
     _searchClient = searchClient;
 }
Example #28
0
 public InvokeServerController(ISearchClient searchClient, ITokenManager tokenManager)
 {
     _tokenManager = tokenManager;
     _searchClient = searchClient;
 }
Example #29
0
 public IntroDialog(ISearchClient searchClient)
 {
     SetField.NotNull(out this.searchClient, nameof(searchClient), searchClient);
 }
Example #30
0
 public RealEstateSearchDialog(ISearchClient searchClient) : base(searchClient, multipleSelection: true)
 {
 }
        public ObservableSearchClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Search;
        }
Example #32
0
 public GitHubIssueRepository(ISearchClient searchClient, IIssuesClient issuesClient)
 {
     this.searchClient = searchClient;
     this.issuesClient = issuesClient;
 }