Exemplo n.º 1
0
        protected override ServiceAddressModel GetServiceAddress(string machineNo, string serviceIdentity)
        {
            var client = new ServiceCollectionClient();

            var address = client.GetServiceAddress(new ServiceAddressRequest()
            {
                No = LocalConfig.MachineNo,

                ServiceGroup = "ExampleGroup",

                ServiceIdentity = serviceIdentity,

                MMode = ServiceAddressRequest.MatchMode.No,
            });

            client.Close();

            if (address == null)
                return null;

            return new ServiceAddressModel()
            {
                Address = address.Address,
                ServiceIdentity = address.ServiceIdentity, 
                PropertyList = address.PropertyList,
            };
        }
Exemplo n.º 2
0
 public CloudSearchProviderSuggestionIndex(string name, string connectionStringName, string totalParallelServices, IIndexPropertyStore propertyStore)
     : base(name, connectionStringName, totalParallelServices, propertyStore)
 {
     ConnectionStringName = connectionStringName;
     indexNameProvider    = new CloudSearchProviderIndexName(ServiceCollectionClient.GetInstance <IFactoryWrapper>());// ServiceCollectionClient.GetInstance<ICloudSearchProviderIndexName>(Array.Empty<object>());
     _settings            = ServiceCollectionClient.GetInstance <Settings>();
 }
Exemplo n.º 3
0
        internal void SwitchIndexes(string searchIndexName, string rebuildIndexName)
        {
            SearchCloudIndexName  = rebuildIndexName;
            RebuildCloudIndexName = searchIndexName;
            ISearchService instance = ServiceCollectionClient.GetInstance <ISearchService>();

            if (!TryInitializeCloudIndexFromConnectionString(instance as ISwitchSearchIndexInitializable))
            {
                return;
            }
            SearchService = instance;
        }
Exemplo n.º 4
0
        protected override IProviderUpdateContext CreateRebuildContext()
        {
            EnsureInitialized();
            RebuildService = ServiceCollectionClient.GetInstance <ISearchService>();
            var ourType = RebuildService as ISwitchSearchIndexInitializable;

            if (ourType != null)
            {
                ourType.Initialize(this, RebuildCloudIndexName);
            }
            else
            {
                Type.GetType("Sitecore.ContentSearch.Azure.ISwitchSearchIndexInitializable, Sitecore.ContentSearch.Azure").GetMethod("Initialize").Invoke(RebuildService, new object[] { this, RebuildCloudIndexName });
            }
            return(((AbstractCloudSearchContextFactory)ProviderContextFactory).CreateUpdateContext(this, RebuildService));
        }
Exemplo n.º 5
0
 public CompositeSearchService(ServiceCollectionClient serviceCollectionClient)
 {
     _serviceCollectionClient = serviceCollectionClient;
     _innerServices           = new List <ISearchService>();
 }