elastalk

elastalk and Flask

When we built this library we figured you just might want to use it in your Flask applications. With that in mind we’ve provided a few conveniences.

Configuration from Objects

Flask applications objects support a convention that allows you to configure the application using the name of a Python class via a method on the application’s configuration object called from_object().

Sticking with that convention, the ElastalkConnection in this library has config attribute which returns an ElastalkConf. Like the Flask configuration object, this configuration object supports a method called from_object that mirrors the behavior of the Flask method.

Options

This section describes the configuration options you can use when configuring your Elasticsearch settings from an object.

ESHOSTS

a Python list, or comma-separated string containing the Elasticsearch seed hosts

ES_SNIFF_ON_START

See Sniffing on startup and ElastalkConf.sniff_on_start

ES_SNIFF_ON_CONNECTION_FAIL

See Sniffing on connection failure and ElastalkConf.sniff_on_connection_fail

ES_SNIFFER_TIMEOUT

See Python Elasticsearch Client and ElastalkConf.sniffer_timeout

ES_MAXSIZE

the maximum number of concurrent connections the client may make

ES_MAPPING_FIELD_LIMIT

the maximum number of fields in an index

Note

Field and object mappings, as well as field aliases count towards this limit.