Module djangoes.backends provides abstract classes for djangoes backends.
All backends are expecting to subclass these abstract classes and to implement their behaviors.
- class Base(alias, server, indices)¶
ElasticSearch backend wrapper base.
List of names to use to perform ElasticSearch queries.
For each configured index, a connection will use either its index name, or its list of aliases if at least one is defined.
For example, if a connection uses 2 indices, one with only the index index, and the second one with the index_2 index and an alias ̀ alias`, the result ̀ indices` will be ['index', 'alias'].
List of names of all configured indices, without their aliases.
It is the same list of indices but where indices are not replaced by their aliases.
It is particulary useful when indices need to be created for example.
List of names of all configured indices’s aliases, without their indices.
It is the same list of indices but where only aliases are presents.
It is particulary useful when aliases need to be created for example.
Configure the ElasticSearch client.
Build and return the list of alias names.
This create a list of unique alias names, without using their indices. It can be useful to get alias names instead of their usage names, as given by indices as it would gives index names when no alias is configured - which is not always what is needed.
Build and return the list of index names.
This create a list of unique index names, without using their aliases. It can be useful to get index names instead of their usage names, as given by indices, for example when one wants to create them.
Build the list of indices or aliases used to query ElasticSearch.
This creates a list composed of index names or alias names. If an index defined aliases, these aliases will be used instead of its own name.
- class MetaClientBase(conn)¶
ElasticSearch meta client base.
The meta client aims to provide an interface to the “meta” API of ElasticSearch, ie. manipulation of indices (creation, deletion, etc.), of cluster and nodes (settings), and of snapshot (backup/restore).
The base class exposes a simple interface with 4 main attributes that must be implemented in the child class:
Access to meta API about cluster.
Access to meta API about indices.
Access to meta API about nodes.
Access to meta API about snapshot.
Connection backends based on the elasticsearch official python library.
This module aims to contain only basic backend classes using the elasticsearch official python library and its basics transport classes with few changes.
At the moment it only provides the SimpleHttpBackend, based on the default transport class.
- class SimpleHttpBackend(alias, server, indices)¶
Connection wrapper based on the ElasticSearch official library.
Instantiate and configure the ElasticSearch client.
It simply takes the given HOSTS list and uses PARAMS as the keyword arguments of the Elasticsearch class.
The client’s transport_class is given by the class attribute transport_class.
alias of MetaClient
alias of Transport