pyes.connection_http

pyes.connection_http.connect(servers=None, framed_transport=False, timeout=None, retry_time=60, recycle=None, round_robin=None, max_retries=3)

Constructs a single ElastiSearch connection. Connects to a randomly chosen server on the list.

If the connection fails, it will attempt to connect to each server on the list in turn until one succeeds. If it is unable to find an active server, it will throw a NoServerAvailable exception.

Failing servers are kept on a separate list and eventually retried, no sooner than retry_time seconds after failure.

servers : [server]

List of ES servers with format: “hostname:port”

Default: [‘127.0.0.1:9200’]

framed_transport: bool
If True, use a TFramedTransport instead of a TBufferedTransport
timeout: float

Timeout in seconds (e.g. 0.5)

Default: None (it will stall forever)

retry_time: float

Minimum time in seconds until a failed server is reinstated. (e.g. 0.5)

Default: 60

recycle: float

Max time in seconds before an open connection is closed and returned to the pool.

Default: None (Never recycle)

max_retries: int
Max retry time on connection down
round_robin: bool
DEPRECATED

ES client

pyes.connection_http.connect_thread_local(servers=None, framed_transport=False, timeout=None, retry_time=60, recycle=None, round_robin=None, max_retries=3)

Constructs a single ElastiSearch connection. Connects to a randomly chosen server on the list.

If the connection fails, it will attempt to connect to each server on the list in turn until one succeeds. If it is unable to find an active server, it will throw a NoServerAvailable exception.

Failing servers are kept on a separate list and eventually retried, no sooner than retry_time seconds after failure.

servers : [server]

List of ES servers with format: “hostname:port”

Default: [‘127.0.0.1:9200’]

framed_transport: bool
If True, use a TFramedTransport instead of a TBufferedTransport
timeout: float

Timeout in seconds (e.g. 0.5)

Default: None (it will stall forever)

retry_time: float

Minimum time in seconds until a failed server is reinstated. (e.g. 0.5)

Default: 60

recycle: float

Max time in seconds before an open connection is closed and returned to the pool.

Default: None (Never recycle)

max_retries: int
Max retry time on connection down
round_robin: bool
DEPRECATED

ES client

Previous topic

pyes.connection

Next topic

pyes.es

This Page