Configuring Your Connection¶
Configuration from Objects¶
If you’re wanting to configure your connection from a python object, you’re likely using Flask. There is another article on that subject called Configuration from Objects.
Configuration from TOML¶
In addition to configuring from objects, you can also configure elastalk connections using TOML.
TOML aims to be a minimal configuration file format that’s easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table.
—the TOML project’s README.md
A Sample TOML Configuration¶
[blobs]
excluded = ["owner_", "group_"]
[indexes.cats]
mappings = "cats/mappings.json"
[indexes.dogs.blobs]
enabled = True
excluded = ["name", "breed"]
Options¶
- seeds
a list, or comma-separated string containing the Elasticsearch seed hosts
See also
- sniff_on_start
- sniff_on_connection_fail
See Sniffing on connection failure and
ElastalkConf.sniff_on_connection_fail
- sniffer_timeout
See Python Elasticsearch Client and
ElastalkConf.sniffer_timeout
- maxsize
the maximum number of concurrent connections the client may make
See also
- 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.
blobs¶
This section contains global configuration options that control how, when, and which data is converted to binary representations (see Blobbing).
- enabled
indicates whether or not blobbing is enabled
- excluded
the names of attributes that are never included in binary representations when a document is packed using the
ElastalkConnection.pack()
method- key
the key that stores blobbed values in packed documents
indexes¶
This section contains information about specific Elasticsearch Indexes. In the example above there are two configured indexes: cats and dogs. You can configure individual index preferences by adding creating a new section and appending the index name to indexes.