public SearchIndexClientProvider(
     ISearchServiceClientProvider searchServiceClientProvider,
     IIndexNameResolver indexNameResolver)
 {
     _indexNameResolver   = indexNameResolver;
     _searchServiceClient = searchServiceClientProvider.Get();
 }
 /// <summary>
 /// 初始化一个<see cref="ElasticsearchContext"/>类型的实例
 /// </summary>
 /// <param name="provider">ES客户端提供程序</param>
 /// <param name="resolver">索引名称解析器</param>
 /// <param name="options">ES选项配置</param>
 public ElasticsearchContext(IElasticClientProvider provider, IIndexNameResolver resolver, IOptions <ElasticsearchOptions> options)
 {
     _provider = provider;
     _resolver = resolver;
     _client   = provider.GetClient();
     _options  = options.Value;
 }
        public AerospikeRepository(AsyncClient aerospikeClient, string ns, IAerospikeEntityMapper aerospikeEntityMapper, IIndexNameResolver indexNameResolver)
        {
            _aerospikeClient        = aerospikeClient;
            _aerospikeEntityMapper  = aerospikeEntityMapper;
            _indexNameResolver      = indexNameResolver;
            _namespace              = ns;
            CancellationTokenSource = new CancellationTokenSource();
            _addWritePolicy         = new WritePolicy
            {
                recordExistsAction = RecordExistsAction.CREATE_ONLY
            };

            _updateWritePolicy = new WritePolicy
            {
                recordExistsAction = RecordExistsAction.REPLACE_ONLY
            };
        }
        public ElasticSearchBufferedWriter(Func <ElasticClient> elasticClientFactory, IIndexNameResolver indexNameResolver, ITypeNameResolver typeNameResolver, Action throwOnMissingConfiguration)
        {
            if (elasticClientFactory == null)
            {
                throw new ArgumentNullException("elasticClientFactory");
            }
            if (indexNameResolver == null)
            {
                throw new ArgumentNullException("indexNameResolver");
            }
            if (typeNameResolver == null)
            {
                throw new ArgumentNullException("typeNameResolver");
            }
            if (throwOnMissingConfiguration == null)
            {
                throw new ArgumentNullException("throwOnMissingConfiguration");
            }

            _elasticClientFactory        = elasticClientFactory;
            _indexNameResolver           = indexNameResolver;
            _typeNameResolver            = typeNameResolver;
            _throwOnMissingConfiguration = throwOnMissingConfiguration;
        }
 public ElasticSearchBufferedWriter(Func <ElasticClient> elasticClientFactory,
                                    IIndexNameResolver indexNameResolver, ITypeNameResolver typeNameResolver)
     : this(elasticClientFactory, indexNameResolver, typeNameResolver, ConfigChecker.EnsureRequiredConfiguration)
 {
 }