public ElasticClientFactory( IConnectionSettingsValues settings = null, IConnection connection = null, ITransport transport = null, INestSerializer serializer = null) { this.CreateClient(settings, connection, transport, serializer); }
/// <summary> /// Instantiate a new strongly typed connection to elasticsearch /// </summary> /// <param name="settings">An optional settings object telling the client how and where to connect to. /// <para>Defaults to a static single node connection pool to http://localhost:9200</para> /// <para>It's recommended to pass an explicit 'new ConnectionSettings()' instance</para> /// </param> /// <param name="connection">Optionally provide a different connection handler, defaults to http using HttpWebRequest</param> /// <param name="serializer">Optionally provide a custom serializer responsible for taking a stream and turning into T</param> /// <param name="transport">The transport coordinates requests between the client and the connection pool and the connection</param> public ElasticClient( IConnectionSettingsValues settings = null, IConnection connection = null, INestSerializer serializer = null, ITransport transport = null) { this._connectionSettings = settings ?? new ConnectionSettings(); this.Connection = connection ?? new HttpConnection(this._connectionSettings); this.Serializer = serializer ?? new NestSerializer(this._connectionSettings); this.Raw = new ElasticsearchClient( this._connectionSettings, this.Connection, transport, //default transport this.Serializer ); this.RawDispatch = new RawDispatch(this.Raw); this.Infer = this._connectionSettings.Inferrer; }
public ElasticClient(IConnectionSettings settings, IConnection connection = null, INestSerializer serializer = null) { if (settings == null) { throw new ArgumentNullException("settings"); } this._connectionSettings = settings; this.Connection = connection ?? new Connection(settings); this.Serializer = serializer ?? new NestSerializer(this._connectionSettings); this.Raw = new RawElasticClient(this._connectionSettings, this.Connection, this.Serializer); this.RawDispatch = new RawDispatch(this.Raw); this.Infer = new ElasticInferrer(this._connectionSettings); }
private void CreateClient(IConnectionSettingsValues settings, IConnection connection, ITransport transport, INestSerializer serializer) { this.client = new ElasticClient(settings, connection, serializer, transport); }
protected abstract Tuple <string, int> ExpectedResponse(INestSerializer serializer);