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:
- ES_VERSION_SUPPORTED = False[source]¶
Whether the installed version of the elasticsearch module is supported.
- Type:
- class ElasticsearchConfigForm(*args, **kwargs)[source]¶
Bases:
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:
SearchBackend
A search backend for integrating with Elasticsearch
- 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
ElasticsearchConfigForm
- form_field_map = {'index_name': 'INDEX_NAME', 'url': 'URL'}[source]¶
A mapping of search engine settings to form fields.
- __annotations__ = {}¶
- validate(**kwargs) None [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.