Class ElasticsearchBackendSettings
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.cfg.ElasticsearchBackendSettings
-
public final class ElasticsearchBackendSettings extends Object
Configuration properties for Elasticsearch backends.Constants in this class are to be appended to a prefix to form a property key; see
BackendSettingsfor details.- Author:
- Gunnar Morling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElasticsearchBackendSettings.DefaultsDefault values for the different settings if no values are given.
-
Field Summary
Fields Modifier and Type Field Description static StringCONNECTION_TIMEOUTThe timeout when establishing a connection to an Elasticsearch server.static StringDISCOVERY_ENABLEDWhether automatic discovery of nodes in the Elasticsearch cluster is enabled.static StringDISCOVERY_REFRESH_INTERVALThe time interval between two executions of the automatic discovery, if enabled.static StringHOSTSThe host name and ports of the Elasticsearch servers to connect to.static StringLAYOUT_STRATEGYThe layout strategy for indexes and their aliases.static StringLOG_JSON_PRETTY_PRINTINGWhether JSON included in logs should be pretty-printed (indented, with line breaks).static StringMAPPING_TYPE_NAME_STRATEGYThe strategy for mapping documents to their type name, i.e.static StringMAX_CONNECTIONSThe maximum number of simultaneous connections to the Elasticsearch cluster, all hosts taken together.static StringMAX_CONNECTIONS_PER_ROUTEThe maximum number of simultaneous connections to each host of the Elasticsearch cluster.static StringMULTI_TENANCY_STRATEGYThe multi-tenancy strategy to use.static StringPASSWORDThe password to send when connecting to the Elasticsearch servers (HTTP authentication).static StringPATH_PREFIXProperty for specifying the path prefix prepended to the request end point.static StringPROTOCOLThe protocol to use when connecting to the Elasticsearch servers.static StringREAD_TIMEOUTThe timeout when reading responses from an Elasticsearch server.static StringREQUEST_TIMEOUTThe timeout when executing a request to an Elasticsearch server.static StringSCROLL_TIMEOUTProperty for specifying the maximum duration aScrollwill be usable if no other results are fetched from Elasticsearch.static StringTHREAD_POOL_SIZEThe size of the thread pool assigned to the backend.static StringTYPE_NAMEThe name to use for thebackend typeconfiguration property so that an Elasticsearch backend is instantiated by Hibernate Search.static StringURISstatic StringUSERNAMEThe username to send when connecting to the Elasticsearch servers (HTTP authentication).static StringVERSIONThe version of Elasticsearch running on the Elasticsearch cluster.static StringVERSION_CHECK_ENABLEDWhether check version of the Elasticsearch cluster is enabled.
-
-
-
Field Detail
-
TYPE_NAME
public static final String TYPE_NAME
The name to use for thebackend typeconfiguration property so that an Elasticsearch backend is instantiated by Hibernate Search.Only useful if you have more than one backend technology in the classpath; otherwise the backend type is automatically detected.
- See Also:
- Constant Field Values
-
HOSTS
public static final String HOSTS
The host name and ports of the Elasticsearch servers to connect to.Expects a String representing a host and port such as
localhostores.mycompany.com:4400, or a String containing multiple such host-and-port strings separated by commas, or aCollection<String>containing such host-and-port strings.Cannot be used if
URISis set.Defaults to
ElasticsearchBackendSettings.Defaults.HOSTS.Multiple servers may be specified for load-balancing: requests will be assigned to each host in turns.
- See Also:
- Constant Field Values
-
PROTOCOL
public static final String PROTOCOL
The protocol to use when connecting to the Elasticsearch servers.Expects a String: either
httporhttps.Cannot be used if
URISis set.Defaults to
ElasticsearchBackendSettings.Defaults.PROTOCOL.- See Also:
- Constant Field Values
-
URIS
public static final String URIS
Alternatively toHOSTSandPROTOCOL, it is possible to define both the protocol and hosts as one or more URIs using this property.Expects either a String representing an URI such as
http://localhostorhttps://es.mycompany.com:4400, or a String containing multiple such URIs separated by commas, or aCollection<String>containing such URIs.All the URIs must have the same protocol. Cannot be used if
HOSTSorPROTOCOLare set.Defaults to
http://localhost:9200, unlessHOSTSorPROTOCOLare set, in which case they take precedence.- See Also:
- Constant Field Values
-
PATH_PREFIX
public static final String PATH_PREFIX
Property for specifying the path prefix prepended to the request end point. Use the path prefix if your Elasticsearch instance is located at a specific context path.Defaults to
ElasticsearchBackendSettings.Defaults.PATH_PREFIX.- See Also:
- Constant Field Values
-
VERSION
public static final String VERSION
The version of Elasticsearch running on the Elasticsearch cluster.Expects either an
ElasticsearchVersionobject, or a String that can be {parsedin such an object.No default: if not provided, the version will be resolved automatically by sending a request to the Elasticsearch cluster on startup.
- See Also:
- Constant Field Values
-
VERSION_CHECK_ENABLED
public static final String VERSION_CHECK_ENABLED
Whether check version of the Elasticsearch cluster is enabled.Expects a Boolean value such as
trueorfalse, or a string that can be parsed to such Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.VERSION_CHECK_ENABLED.- See Also:
- Constant Field Values
-
USERNAME
public static final String USERNAME
The username to send when connecting to the Elasticsearch servers (HTTP authentication).Expects a String.
Defaults to no username (anonymous access).
- See Also:
- Constant Field Values
-
PASSWORD
public static final String PASSWORD
The password to send when connecting to the Elasticsearch servers (HTTP authentication).Expects a String.
Defaults to no username (anonymous access).
- See Also:
- Constant Field Values
-
REQUEST_TIMEOUT
public static final String REQUEST_TIMEOUT
The timeout when executing a request to an Elasticsearch server.This includes the time needed to establish a connection, send the request and read the response.
Expects a positive Integer value in milliseconds, such as 60000, or a String that can be parsed into such Integer value.
Defaults to no request timeout.
- See Also:
- Constant Field Values
-
READ_TIMEOUT
public static final String READ_TIMEOUT
The timeout when reading responses from an Elasticsearch server.Expects a positive Integer value in milliseconds, such as
60000, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.READ_TIMEOUT.- See Also:
- Constant Field Values
-
CONNECTION_TIMEOUT
public static final String CONNECTION_TIMEOUT
The timeout when establishing a connection to an Elasticsearch server.Expects a positive Integer value in milliseconds, such as
3000, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.CONNECTION_TIMEOUT.- See Also:
- Constant Field Values
-
MAX_CONNECTIONS
public static final String MAX_CONNECTIONS
The maximum number of simultaneous connections to the Elasticsearch cluster, all hosts taken together.Expects a positive Integer value, such as
20, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.MAX_CONNECTIONS.- See Also:
- Constant Field Values
-
MAX_CONNECTIONS_PER_ROUTE
public static final String MAX_CONNECTIONS_PER_ROUTE
The maximum number of simultaneous connections to each host of the Elasticsearch cluster.Expects a positive Integer value, such as
10, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.MAX_CONNECTIONS_PER_ROUTE.- See Also:
- Constant Field Values
-
DISCOVERY_ENABLED
public static final String DISCOVERY_ENABLED
Whether automatic discovery of nodes in the Elasticsearch cluster is enabled.Expects a Boolean value such as
trueorfalse, or a string that can be parsed to such Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.DISCOVERY_ENABLED.- See Also:
- Constant Field Values
-
DISCOVERY_REFRESH_INTERVAL
public static final String DISCOVERY_REFRESH_INTERVAL
The time interval between two executions of the automatic discovery, if enabled.Expects a positive Integer value in seconds, such as
2, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.DISCOVERY_REFRESH_INTERVAL.- See Also:
- Constant Field Values
-
LOG_JSON_PRETTY_PRINTING
public static final String LOG_JSON_PRETTY_PRINTING
Whether JSON included in logs should be pretty-printed (indented, with line breaks).Expects a Boolean value such as
trueorfalse, or a string that can be parsed to such Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.LOG_JSON_PRETTY_PRINTING.- See Also:
- Constant Field Values
-
MULTI_TENANCY_STRATEGY
public static final String MULTI_TENANCY_STRATEGY
The multi-tenancy strategy to use.Expects a
MultiTenancyStrategyNamevalue, or a String representation of such value.Defaults to
ElasticsearchBackendSettings.Defaults.MULTI_TENANCY_STRATEGY.- See Also:
- Constant Field Values
-
MAPPING_TYPE_NAME_STRATEGY
public static final String MAPPING_TYPE_NAME_STRATEGY
The strategy for mapping documents to their type name, i.e. to determine the type name of a document in search hits.Expects a
TypeNameMappingStrategyNamevalue, or a String representation of such value.Defaults to
ElasticsearchBackendSettings.Defaults.MAPPING_TYPE_NAME_STRATEGY.- See Also:
- Constant Field Values
-
LAYOUT_STRATEGY
public static final String LAYOUT_STRATEGY
The layout strategy for indexes and their aliases.Expects a reference to a bean of type
IndexLayoutStrategy.Defaults to the
simplestrategy:- The non-alias name follows the format
<hibernateSearchIndexName>-<6 digits> - The write alias follows the format
<hibernateSearchIndexName>-write - The read alias follows the format
<hibernateSearchIndexName>-read
- The non-alias name follows the format
-
THREAD_POOL_SIZE
public static final String THREAD_POOL_SIZE
The size of the thread pool assigned to the backend.Expects a strictly positive integer value, or a string that can be parsed to such integer value.
Defaults to the number of processor cores available to the JVM on startup.
See the reference documentation, section "Elasticsearch backend - Threads", for more information about this setting and its implications.
- See Also:
- Constant Field Values
-
SCROLL_TIMEOUT
public static final String SCROLL_TIMEOUT
Property for specifying the maximum duration aScrollwill be usable if no other results are fetched from Elasticsearch.Expects a positive Integer value in seconds, such as 60, or a String that can be parsed into such Integer value.
Defaults to
ElasticsearchBackendSettings.Defaults.SCROLL_TIMEOUT.- See Also:
- Constant Field Values
-
-