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, }; }
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>(); }
internal void SwitchIndexes(string searchIndexName, string rebuildIndexName) { SearchCloudIndexName = rebuildIndexName; RebuildCloudIndexName = searchIndexName; ISearchService instance = ServiceCollectionClient.GetInstance <ISearchService>(); if (!TryInitializeCloudIndexFromConnectionString(instance as ISwitchSearchIndexInitializable)) { return; } SearchService = instance; }
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)); }
public CompositeSearchService(ServiceCollectionClient serviceCollectionClient) { _serviceCollectionClient = serviceCollectionClient; _innerServices = new List <ISearchService>(); }