Class ElasticsearchBackendSettings
Constants in this class are to be appended to a prefix to form a property key;
see BackendSettings for details.
- Author:
- Gunnar Morling
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefault values for the different settings if no values are given. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.Use client specific configurers instead.static final StringSpecifies which client factory to use when creating a REST client for the backend to communicate with the Elasticsearch cluster.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringThe hostname and ports of the Elasticsearch servers to connect to.static final StringHow to determine index names and aliases.static final StringWhether JSON included in logs should be pretty-printed (indented, with line breaks).static final StringHow to map documents to their type name, i.e. how to determine the type name of a document in search hits.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringHow to implement multi-tenancy.static final StringThe password to send when connecting to the Elasticsearch servers (HTTP authentication).static final StringProperty for specifying the path prefix prepended to the request end point.static final StringThe protocol to use when connecting to the Elasticsearch servers.static final StringThis property defines if partial shard failures are ignored.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringProperty for specifying the maximum duration ascrollwill be usable if no other results are fetched from Elasticsearch.static final StringThe size of the thread pool assigned to the backend.static final StringThe value to set thebackend typeconfiguration property in order to get an Elasticsearch backend instantiated by Hibernate Search.static final StringThe protocol, hostname and ports of the Elasticsearch servers to connect to.static final StringThe username to send when connecting to the Elasticsearch servers (HTTP authentication).static final StringThe version of Elasticsearch running on the Elasticsearch cluster.static final StringWhether check version of the Elasticsearch cluster is enabled. -
Method Summary
-
Field Details
-
TYPE_NAME
The value to set thebackend typeconfiguration property in order to get an Elasticsearch backend 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:
-
HOSTS
The hostname and ports of the Elasticsearch servers to connect to.Expects a String representing a hostname and port such as
localhostores.mycompany.com:4400, or a String containing multiple such hostname-and-port strings separated by commas, or aCollection<String>containing such hostname-and-port strings.Multiple servers may be specified for load-balancing: requests will be assigned to each host in turns.
Setting this property at the same time as
URISwill lead to an exception being thrown on startup.Defaults to
ElasticsearchBackendSettings.Defaults.HOSTS.- See Also:
-
PROTOCOL
The protocol to use when connecting to the Elasticsearch servers.Expects a String: either
httporhttps.Setting this property at the same time as
URISwill lead to an exception being thrown on startup.Defaults to
ElasticsearchBackendSettings.Defaults.PROTOCOL.- See Also:
-
URIS
The protocol, hostname and ports of the Elasticsearch servers to connect to.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 specify the same protocol.
Setting this property at the same time as
HOSTSorPROTOCOLwill lead to an exception being thrown on startup.Defaults to
http://localhost:9200, unlessHOSTSorPROTOCOLare set, in which case they take precedence.- See Also:
-
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:
-
VERSION
The version of Elasticsearch running on the Elasticsearch cluster.Expects either an
ElasticsearchVersionobject, or a String that can beparsedin 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:
-
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 into a Boolean value.Defaults to
truewhen theVERSIONis unconfigured or set to a distribution that supports version checking, and tofalsewhen theVERSIONis set to a distribution that does not support version checking (like Amazon OpenSearch Serverless).- See Also:
-
USERNAME
The username to send when connecting to the Elasticsearch servers (HTTP authentication).Expects a String.
Defaults to no username (anonymous access).
- See Also:
-
PASSWORD
The password to send when connecting to the Elasticsearch servers (HTTP authentication).Expects a String.
Defaults to no username (anonymous access).
- See Also:
-
REQUEST_TIMEOUT
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.REQUEST_TIMEOUTinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.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:
-
READ_TIMEOUT
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.READ_TIMEOUTinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.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:
-
CONNECTION_TIMEOUT
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.CONNECTION_TIMEOUTinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.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:
-
MAX_CONNECTIONS
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.MAX_CONNECTIONSinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.The maximum number of simultaneous connections to the Elasticsearch cluster, all hosts taken together.Expects a positive Integer value, such as
40, or a String that can be parsed into such Integer value.Defaults to
ElasticsearchBackendSettings.Defaults.MAX_CONNECTIONS.- See Also:
-
MAX_CONNECTIONS_PER_ROUTE
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.MAX_CONNECTIONS_PER_ROUTEinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.The maximum number of simultaneous connections to each host of the Elasticsearch cluster.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_PER_ROUTE.- See Also:
-
DISCOVERY_ENABLED
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.DISCOVERY_ENABLEDinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.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 into a Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.DISCOVERY_ENABLED.- See Also:
-
DISCOVERY_REFRESH_INTERVAL
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.DISCOVERY_REFRESH_INTERVALinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.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:
-
CLIENT_CONFIGURER
Deprecated, for removal: This API element is subject to removal in a future version.Use client specific configurers instead. The setting itself is not deprecated, it just moved to the client-specific configuration.AElasticsearchHttpClientConfigurerthat defines custom HTTP client configuration.It can be used for example to tune the SSL context to accept self-signed certificates. It allows overriding other HTTP client settings, such as
USERNAMEorMAX_CONNECTIONS_PER_ROUTE.Expects a reference to a bean of type
ElasticsearchHttpClientConfigurer.Defaults to no value.
- See Also:
-
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 into a Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.LOG_JSON_PRETTY_PRINTING.- See Also:
-
MULTI_TENANCY_STRATEGY
How to implement multi-tenancy.Expects a
MultiTenancyStrategyNamevalue, or a String representation of such value.Defaults to
ElasticsearchBackendSettings.Defaults.MULTI_TENANCY_STRATEGY.- See Also:
-
MAPPING_TYPE_NAME_STRATEGY
How to map documents to their type name, i.e. how 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:
-
LAYOUT_STRATEGY
How to determine index names and 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
- See Also:
- The non-alias name follows the format
-
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 into an integer value.
See the reference documentation, section "Elasticsearch backend - Threads", for more information about this setting and its implications.
Defaults to the number of processor cores available to the JVM on startup.
- See Also:
-
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:
-
MAX_KEEP_ALIVE
Deprecated, for removal: This API element is subject to removal in a future version.UseClientRest4ElasticsearchBackendClientSettings.MAX_KEEP_ALIVEinstead. The setting itself is not deprecated, it just moved to the client-specific configuration.How long connections to the Elasticsearch cluster can be kept idle.Expects a positive Long value of milliseconds, such as 60000, or a String that can be parsed into such Integer value.
If the response from an Elasticsearch cluster contains a
Keep-Aliveheader, then the effective max idle time will be whichever is lower: the duration from theKeep-Aliveheader or the value of this property (if set).If this property is not set, only the
Keep-Aliveheader is considered, and if it's absent, idle connections will be kept forever.- See Also:
-
QUERY_SHARD_FAILURE_IGNORE
This property defines if partial shard failures are ignored.In case all shards fail, Elasticsearch cluster will return a 400 status code itself, but if only some of the shards fail, then the client will receive a successful partial response from the shards that were successful.
To prevent getting any partial results this setting can be set to
false. While if the partial failures should be ignored and considered as valid results then the value should be set totrue.Expects a Boolean value such as
trueorfalse, or a string that can be parsed into a Boolean value.Defaults to
ElasticsearchBackendSettings.Defaults.QUERY_SHARD_FAILURE_IGNORE.- See Also:
-
CLIENT_FACTORY
Specifies which client factory to use when creating a REST client for the backend to communicate with the Elasticsearch cluster.
One of the following values can be provided:
jdk-rest, no additional requirements.elasticsearch-rest, current default, requires that theorg.hibernate.search:hibernate-search-backend-elasticsearch-client-rest4remain on the classpath.elasticsearch-rest5, requires that theorg.hibernate.search:hibernate-search-backend-elasticsearch-client-rest5is available on the classpath.opensearch-rest, requires that theorg.hibernate.search:hibernate-search-backend-elasticsearch-client-opensearch-restis available on the classpath.
Defaults to
ElasticsearchBackendSettings.Defaults.CLIENT_FACTORY.- See Also:
-