Jump to >

reviewboard.search.search_backends.elasticsearch

A backend for the Elasticsearch search engine.

SUPPORTED_ES_MAJOR_VERSIONS = (7, 5, 2, 1)[source]

The supported major versions of Elasticsearch.

There must be a backend class available for each version in this list.

Type

tuple

LATEST_ES_MAJOR_VERSION = 7[source]

The latest supported major version of Elasticsearch.

Type

int

ES_VERSION_SUPPORTED = False[source]

Whether the installed version of the elasticsearch module is supported.

Type

bool

class ElasticsearchConfigForm(*args, **kwargs)[source]

Bases: reviewboard.search.search_backends.base.SearchBackendForm

A form for configuring the Elasticsearch search backend.

class Meta[source]

Bases: object

title = 'Elasticsearch'
fieldsets = ((None, {'description': 'Elasticsearch support requires a version of the <a href="https://pypi.org/project/elasticsearch/" target="_blank">elasticsearch</a> Python package that both matches your version of the Elasticsearch server and is compatible with Review Board.\nWe provide convenient packages for each supported major version of Elasticsearch. For example, for Elasticsearch 7.x, install <code>ReviewBoard[elasticsearch7]</code> and then restart your web server:\n<code><strong>$</strong> pip install "ReviewBoard[elasticsearch7]"</code>\n7.x, 5.x, 2.x, and 1.x are supported.', 'fields': ('url', 'index_name')}),)[source]
__annotations__ = {}
declared_fields = {'index_name': <django.forms.fields.CharField object>, 'url': <django.forms.fields.URLField object>}
class ElasticsearchBackend[source]

Bases: reviewboard.search.search_backends.base.SearchBackend

A search backend for integrating with Elasticsearch

search_backend_id = 'elasticsearch'[source]

The search engine’s unique identifier.

name = 'Elasticsearch'[source]

The human-readable name for the search engine.

haystack_backend_name = 'reviewboard.search.search_backends.haystack_backports.elasticsearch_backend.ElasticsearchSearchEngine'[source]

The name of the Haystack search engine backend.

default_settings = {'INDEX_NAME': 'reviewboard', 'URL': 'http://127.0.0.1:9200/'}[source]

The default search engine settings.

config_form_class[source]

alias of reviewboard.search.search_backends.elasticsearch.ElasticsearchConfigForm

__annotations__ = {}
form_field_map = {'index_name': 'INDEX_NAME', 'url': 'URL'}[source]

A mapping of search engine settings to form fields.

validate(**kwargs)[source]

Ensure that the elasticsearch Python module is installed.

Raises

django.core.exceptions.ValidationError – Raised if the elasticsearch module is not installed or the version is incompatible.