Class ElasticsearchIndexSettings


  • public final class ElasticsearchIndexSettings
    extends Object
    Configuration properties for Elasticsearch indexes.

    Constants in this class are to be appended to a prefix to form a property key; see IndexSettings for details.

    • Field Detail

      • SCHEMA_MANAGEMENT_SETTINGS_FILE

        public static final String SCHEMA_MANAGEMENT_SETTINGS_FILE
        The path to a settings file, allowing custom settings for indexes created by Hibernate Search as part of schema management.

        Expects a string representing the path to a UTF-8-encoded file in the classpath. The file must contain index settings expressed in JSON format, with the exact same syntax as expected by the Elasticsearch server under the "settings" property when creating an index. For example, if the file content is {"index.codec": "best_compression"}, it will set index.codec to best_compression.

        Note that the settings generated by Hibernate Search will be overridden in case of conflict of some definitions. For instance, if an analyzer "myAnalyzer" is defined by the ANALYSIS_CONFIGURER and this settings file, the definition from the settings file will take precedence. If it is only defined in either the analysis configurer or the settings file, but not both, it will be preserved as-is.

        Defaults to no value, meaning only index settings generated by Hibernate Search will be used.

        See Also:
        Constant Field Values
      • SCHEMA_MANAGEMENT_MAPPING_FILE

        public static final String SCHEMA_MANAGEMENT_MAPPING_FILE
        The path to a mappings file, allowing custom mappings for indexes created by Hibernate Search as part of schema management.

        Expects a string representing the path to a UTF-8-encoded file in the classpath. The file must contain index settings expressed in JSON format, with the exact same syntax as expected by the Elasticsearch server under the "mappings" property when defining the mapping for an index.

        The file does not need to contain the full mapping: Hibernate Search will automatically inject missing properties (index fields) in the given mapping.

        Conflicts between the given mapping and the mapping generated by Hibernate Search will be handled as follows:

        • Mapping parameters other than properties at the mapping root will be those from the given mapping; those generated by Hibernate Search will be ignored.
        • properties will be merged, using properties defined in both the given mapping and the mapping generated by Hibernate Search. If a property is defined on both sides, mapping parameters from the given mapping will be used, except for properties, which will be merged recursively in the same way.

        Defaults to no value, meaning only index mappings generated by Hibernate Search will be used.

        See Also:
        Constant Field Values
      • INDEXING_PREFIX

        public static final String INDEXING_PREFIX
        The prefix for indexing-related property keys.
        See Also:
        Constant Field Values
      • INDEXING_QUEUE_COUNT

        public static final String INDEXING_QUEUE_COUNT
        The number of indexing queues assigned to each index.

        Expects a strictly positive integer value, or a string that can be parsed into an integer value.

        Defaults to ElasticsearchIndexSettings.Defaults.INDEXING_QUEUE_COUNT.

        See the reference documentation, section "Elasticsearch backend - Indexing", for more information about this setting and its implications.

        See Also:
        Constant Field Values
      • INDEXING_QUEUE_SIZE

        public static final String INDEXING_QUEUE_SIZE
        The size of indexing queues.

        Expects a strictly positive integer value, or a string that can be parsed into an integer value.

        See the reference documentation, section "Elasticsearch backend - Indexing", for more information about this setting and its implications.

        Defaults to ElasticsearchIndexSettings.Defaults.INDEXING_QUEUE_SIZE.

        See Also:
        Constant Field Values
      • INDEXING_MAX_BULK_SIZE

        public static final String INDEXING_MAX_BULK_SIZE
        The maximum size of bulk requests created when processing indexing queues.

        Expects a strictly positive integer value, or a string that can be parsed into an integer value.

        See the reference documentation, section "Elasticsearch backend - Indexing", for more information about this setting and its implications.

        Defaults to ElasticsearchIndexSettings.Defaults.INDEXING_MAX_BULK_SIZE.

        See Also:
        Constant Field Values