org.hibernate.search.elasticsearch.cfg

## Class ElasticsearchEnvironment

- java.lang.Object
- - org.hibernate.search.elasticsearch.cfg.ElasticsearchEnvironment

-     public final class ElasticsearchEnvironment
      extends Object

  Configuration properties for Elasticsearch,
  Author:
    Gunnar Morling

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ElasticsearchEnvironment.Defaults` Default values for the different settings if no values are given.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANALYSIS_DEFINITION_PROVIDER` Provider of default analysis-related definitions for Elasticsearch.
    `static String` | `DISCOVERY_ENABLED` Property for specifying whether automatic discovery of nodes in the Elasticsearch cluster is enabled.
    `static String` | `DISCOVERY_REFRESH_INTERVAL` Property for specifying the time interval between two executions of the automatic discovery, if enabled.
    `static String` | `DISCOVERY_SCHEME` Property for specifying the default scheme to use when connecting to automatically discovered nodes.
    `static String` | `DYNAMIC_MAPPING` Equivalent to elasticsearch "dynamic" mapping attribute, define what to do when an indexed document contains a field which was not declared in the index schema.
    `static String` | `INDEX_MANAGEMENT_WAIT_TIMEOUT` Property for specifying the timeout for index management operations (index creation etc.) in milli-seconds.
    `static String` | `INDEX_SCHEMA_MANAGEMENT_STRATEGY` Property for specifying the strategy for maintaining the Elasticsearch index.
    `static String` | `LOG_JSON_PRETTY_PRINTING` Whether JSON included in logs should be pretty-printed (indented, with line breaks).
    `static String` | `MAX_TOTAL_CONNECTION` Property for specifying the maximum number of simultaneous connections to the Elasticsearch cluster.
    `static String` | `MAX_TOTAL_CONNECTION_PER_ROUTE` Property for specifying the maximum number of simultaneous connections to a single Elasticsearch server.
    `static String` | `REFRESH_AFTER_WRITE` Property for specifying whether an explicit index refresh should be issued after a set of operations targeting a given index has been executed or not.
    `static String` | `REQUIRED_INDEX_STATUS` Property for specifying the status an index must at least have in order for Hibernate Search to work with it.
    `static String` | `SCROLL_BACKTRACKING_WINDOW_SIZE` Property for specifying the the minimum number of previous results kept in memory at any time when scrolling.
    `static String` | `SCROLL_FETCH_SIZE` Property for specifying the the number of results fetched by each Elasticsearch call when scrolling.
    `static String` | `SCROLL_TIMEOUT` Property for specifying the maximum duration `ScrollableResults` will be usable if no other results are fetched from Elasticsearch, in seconds.
    `static String` | `SERVER_CONNECTION_TIMEOUT` Property for specifying the timeout when connecting to an Elasticsearch server.
    `static String` | `SERVER_PASSWORD` Property for specifying the password to send when connecting to the Elasticsearch servers.
    `static String` | `SERVER_READ_TIMEOUT` Property for specifying the timeout when reading responses from an Elasticsearch server.
    `static String` | `SERVER_REQUEST_TIMEOUT` Property for specifying the timeout when executing a request to an Elasticsearch server.
    `static String` | `SERVER_URI` Property for specifying the host names and HTTP ports of the Elasticsearch servers to connect to.
    `static String` | `SERVER_USERNAME` Property for specifying the username to send when connecting to the Elasticsearch servers.

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SERVER_URI

          public static final String SERVER_URI

      Property for specifying the host names and HTTP ports of the Elasticsearch servers to connect to.

      URIs such as http://myeshost.com:9200 are expected, separated by whitespace characters.

      Defaults to `ElasticsearchEnvironment.Defaults.SERVER_URI`.

      Multiple servers may be specified for load-balancing: requests will be assigned to each host in turns. Failover is not supported yet.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.host`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### SERVER_USERNAME

          public static final String SERVER_USERNAME

      Property for specifying the username to send when connecting to the Elasticsearch servers.

      A string is expected.

      Defaults to no username (anonymous access).

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.username`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### SERVER_PASSWORD

          public static final String SERVER_PASSWORD

      Property for specifying the password to send when connecting to the Elasticsearch servers.

      A string is expected.

      Defaults to no password at all.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.password`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### SERVER_REQUEST_TIMEOUT

          public static final String SERVER_REQUEST_TIMEOUT

      Property for specifying the timeout when executing a request to an Elasticsearch server.

      This includes the time needed to establish a connection, send the request and receive the whole response, optionally re-trying multiple times in case of node failure.

      A numeric value in milliseconds, such as 60000 is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SERVER_REQUEST_TIMEOUT`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.request_timeout`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### SERVER_READ_TIMEOUT

          public static final String SERVER_READ_TIMEOUT

      Property for specifying the timeout when reading responses from an Elasticsearch server.

      A numeric value in milliseconds, such as 60000 is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SERVER_READ_TIMEOUT`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.read_timeout`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### SERVER_CONNECTION_TIMEOUT

          public static final String SERVER_CONNECTION_TIMEOUT

      Property for specifying the timeout when connecting to an Elasticsearch server.

      A numeric value in milliseconds, such as 2000 is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SERVER_CONNECTION_TIMEOUT`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.connection_timeout`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### MAX_TOTAL_CONNECTION

          public static final String MAX_TOTAL_CONNECTION

      Property for specifying the maximum number of simultaneous connections to the Elasticsearch cluster.

      A positive numeric value is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.MAX_TOTAL_CONNECTION`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.max_total_connection`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### MAX_TOTAL_CONNECTION_PER_ROUTE

          public static final String MAX_TOTAL_CONNECTION_PER_ROUTE

      Property for specifying the maximum number of simultaneous connections to a single Elasticsearch server.

      A positive numeric value is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.MAX_TOTAL_CONNECTION_PER_ROUTE`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.max_total_connection_per_route`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### DISCOVERY_ENABLED

          public static final String DISCOVERY_ENABLED

      Property for specifying whether automatic discovery of nodes in the Elasticsearch cluster is enabled.

      Either `true` or `false` is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.DISCOVERY_ENABLED`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.discovery.enabled`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### DISCOVERY_REFRESH_INTERVAL

          public static final String DISCOVERY_REFRESH_INTERVAL

      Property for specifying the time interval between two executions of the automatic discovery, if enabled.

      A positive numeric value in seconds is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.DISCOVERY_REFRESH_INTERVAL`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.discovery.refresh_interval`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### DISCOVERY_SCHEME

          public static final String DISCOVERY_SCHEME

      Property for specifying the default scheme to use when connecting to automatically discovered nodes.

      Either "http" or "https" is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.DISCOVERY_SCHEME`.

      To be given globally only (i.e. prefixed with `hibernate.search.default.`). Cannot be specified per index (e.g. `hibernate.search.myIndex.elasticsearch.discovery.default_scheme`). This limitation will be removed in a future version of Hibernate Search.

      See Also:
        Constant Field Values

    - #### INDEX_SCHEMA_MANAGEMENT_STRATEGY

          public static final String INDEX_SCHEMA_MANAGEMENT_STRATEGY

      Property for specifying the strategy for maintaining the Elasticsearch index.

      The external name of one of the `IndexSchemaManagementStrategy` constants is expected, e.g. 'update' (the external names can be retrieved programmatically using `IndexSchemaManagementStrategy.getExternalName()`).

      Can be given globally (e.g. `hibernate.search.default.elasticsearch.index_schema_management_strategy=update`) or for specific indexes (e.g. `hibernate.search.someindex.elasticsearch.index_schema_management_strategy=drop-and-create`).

      See Also:
        Constant Field Values

    - #### INDEX_MANAGEMENT_WAIT_TIMEOUT

          public static final String INDEX_MANAGEMENT_WAIT_TIMEOUT

      Property for specifying the timeout for index management operations (index creation etc.) in milli-seconds.

      A numeric value such as 1000 is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.INDEX_MANAGEMENT_WAIT_TIMEOUT` ms.

      Can be given globally (e.g. `hibernate.search.default.elasticsearch.index_management_wait_timeout=5000`) or for specific indexes (e.g. `hibernate.search.someindex.elasticsearch.index_management_wait_timeout=2000`).

      See Also:
        Constant Field Values

    - #### REQUIRED_INDEX_STATUS

          public static final String REQUIRED_INDEX_STATUS

      Property for specifying the status an index must at least have in order for Hibernate Search to work with it.

      One of 'green', 'yellow' or 'red' is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.REQUIRED_INDEX_STATUS`.

      Can be given globally (e.g. `hibernate.search.default.elasticsearch.required_index_status=green`) or for specific indexes (e.g. `hibernate.search.someindex.elasticsearch.required_index_status=yellow`).

      See Also:
        Constant Field Values

    - #### REFRESH_AFTER_WRITE

          public static final String REFRESH_AFTER_WRITE

      Property for specifying whether an explicit index refresh should be issued after a set of operations targeting a given index has been executed or not.

      A boolean value (true, false) is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.REFRESH_AFTER_WRITE`.

      Can be given globally (e.g. `hibernate.search.default.elasticsearch.refresh_after_write=false`) or for specific indexes (e.g. `hibernate.search.someindex.elasticsearch.refresh_after_write=true`).

      See Also:
        Constant Field Values

    - #### SCROLL_BACKTRACKING_WINDOW_SIZE

          public static final String SCROLL_BACKTRACKING_WINDOW_SIZE

      Property for specifying the the minimum number of previous results kept in memory at any time when scrolling.

      This determines the number of positions one will be able to scroll backward (backtracking) without starting over the scrolling.

      A strictly positive value is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SCROLL_BACKTRACKING_WINDOW_SIZE`.

      Can only be given globally (e.g. `hibernate.search.elasticsearch.scroll_backtracking_window_size=10000`).

      See Also:
        Constant Field Values

    - #### SCROLL_FETCH_SIZE

          public static final String SCROLL_FETCH_SIZE

      Property for specifying the the number of results fetched by each Elasticsearch call when scrolling.

      A strictly positive value is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SCROLL_FETCH_SIZE`.

      Can only be given globally (e.g. `hibernate.search.elasticsearch.scroll_fetch_size=1000`).

      See Also:
        Constant Field Values

    - #### SCROLL_TIMEOUT

          public static final String SCROLL_TIMEOUT

      Property for specifying the maximum duration `ScrollableResults` will be usable if no other results are fetched from Elasticsearch, in seconds.

      A strictly positive value is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.SCROLL_TIMEOUT`.

      Can only be given globally (e.g. `hibernate.search.elasticsearch.scroll_timeout=60`).

      See Also:
        Constant Field Values

    - #### DYNAMIC_MAPPING

          public static final String DYNAMIC_MAPPING

      Equivalent to elasticsearch "dynamic" mapping attribute, define what to do when an indexed document contains a field which was not declared in the index schema.

      Possible values are:

      - `true`: Add unknown fields to the schema dynamically
      - `false`: Ignore unknown fields
      - `strict`: Throw an exception on unknown fields

      Defaults to `strict`.

      Can be given globally (e.g. `hibernate.search.default.elasticsearch.dynamic_mapping=false`) or for specific indexes (e.g. `hibernate.search.someindex.elasticsearch.dynamic_mapping=true`).

      See Also:
        Constant Field Values

    - #### ANALYSIS_DEFINITION_PROVIDER

          public static final String ANALYSIS_DEFINITION_PROVIDER

      Provider of default analysis-related definitions for Elasticsearch.

      The value must be the fully-qualified name of a class implementing `ElasticsearchAnalysisDefinitionProvider`.

      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).

      A boolean value (true, false) is expected.

      Defaults to `ElasticsearchEnvironment.Defaults.LOG_JSON_PRETTY_PRINTING`.

      Can only be given globally (e.g. `hibernate.search.elasticsearch.log.json_pretty_printing=true`).

      See Also:
        Constant Field Values

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved