org.hibernate.search.cfg

## Class Environment

- java.lang.Object
- - org.hibernate.search.cfg.Environment

-     public final class Environment
      extends Object

  Author:
    Emmanuel Bernard, Hardy Ferentschik

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANALYSIS_DEFINITION_PROVIDER` Provider of default analysis-related definitions for Lucene.
    `static String` | `ANALYZER_CLASS` Default Lucene analyser
    `static String` | `ASYNC_READER_REFRESH_PERIOD_MS` When the "async" reader strategy is enabled queries might be allowed to use a stale read of the index; this property controls how often the indexes are refreshed, in milliseconds.
    `static String` | `AUTOREGISTER_LISTENERS` Enable listeners auto registration in Hibernate Annotations and EntityManager.
    `static String` | `CACHE_DOCIDRESULTS_SIZE` number of docidresults cached in hard reference.
    `static String` | `DATABASE_RETRIEVAL_METHOD` Property name to set the default database retrieval method during object initialization.
    `static Version` | `DEFAULT_LUCENE_MATCH_VERSION` If nothing else is specified we use `Version.LUCENE_CURRENT` as the default Lucene version.
    `static String` | `DEFAULT_NULL_TOKEN` Parameter name used to configure the default null token
    `static Map<Class<? extends Service>,String>` | `DEFAULT_SERVICES_MAP`
    `static String` | `ENABLE_DIRTY_CHECK` When enabled re-indexing of an entity is skipped if the updates affect only non-indexed fields.
    `static String` | `ERROR_HANDLER` Option for specifying an error handler used during processing of the Lucene updates.
    `static String` | `EXCLUSIVE_INDEX_USE` When set to true a lock on the index will not be released until the SearchIntegrator (or SessionFactory) is closed.
    `static String` | `FILTER_CACHING_STRATEGY` filter caching strategy class (must have a no-arg constructor and implement FilterCachingStrategy)
    `static String` | `GENERATE_STATS` If set to `true` the search statistic will be gathered.
    `static String` | `INDEX_BASE_PROP_NAME` Option for setting the base directory for storing Lucene indexes when working with file-system based directories.
    `static String` | `INDEX_FLUSH_INTERVAL` The lucene backend can operate in async mode, and can apply changes to the index at regular intervals, effectively collapsing incoming changesets in order to reduce the amount of commits.
    `static String` | `INDEX_MANAGER_IMPL_NAME` Used to specify an alternative IndexManager implementation for a specific index.
    `static String` | `INDEX_METADATA_COMPLETE` Boolean setting, defaults to `true`.
    `static String` | `INDEX_NAME_JMS_PROPERTY` Name of the JMS message property containing the index name to which to apply remote work.
    `static String` | `INDEX_NAME_PROP_NAME` Option for specifying an index name for specific entities.
    `static String` | `INDEX_UNINVERTING_ALLOWED` Option for allowing or disallowing index uninverting when sorting on fields not covered by doc value fields.
    `static String` | `INDEXING_STRATEGY` Defines the indexing strategy, default `event` Other options `manual`
    `static String` | `JMX_BEAN_SUFFIX` If JMX bean deployment is enabled (see `JMX_ENABLED`) the specified suffix will be appended to the registered MBean names.
    `static String` | `JMX_ENABLED` If set to `true` JMX beans get enabled.
    `static String` | `LOCKING_STRATEGY` Option for setting the locking strategy to be used for locking Lucene directories.
    `static String` | `LUCENE_MATCH_VERSION` The Lucene match version parameter.
    `static String` | `MAX_QUEUE_LENGTH` The lucene backend has a separate writing thread for each index, the work pushed to each thread is put in a queue which grows up to a maximum number of elements, which is configured by this setting and defaults to 1000.
    `static String` | `MODEL_MAPPING` Provide a programmatic mapping model to Hibernate Search configuration Accepts a fully populated SearchMapping object or a fully qualified class name of a SearchMapping factory.
    `static String` | `OBJECT_LOOKUP_METHOD` Property name to set the default object lookup method during object initialization.
    `static String` | `QUEUEINGPROCESSOR_BATCHSIZE` Defines the maximum number of indexing operation batched per transaction
    `static String` | `READER_PREFIX` define the reader prefix
    `static String` | `READER_STRATEGY` define the reader strategy used
    `static String` | `RETRY_MARKER_LOOKUP` Number of times we retry the logic looking for marker files in master's directory before giving up and raising an exception.
    `static String` | `SIMILARITY_CLASS` Default Lucene similarity
    `static String` | `SIMILARITY_CLASS_PER_INDEX` Define the similarity class name for a given index
    `static String` | `WORKER_BACKEND`
    `static String` | `WORKER_ENLIST_IN_TRANSACTION` When set to `true` the indexing operations will be passed to the indexing backend within the transaction.
    `static String` | `WORKER_EXECUTION`
    `static String` | `WORKER_PREFIX`
    `static String` | `WORKER_SCOPE`

  - ### Method Summary

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

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

- - ### Field Detail

    - #### OBJECT_LOOKUP_METHOD

          public static final String OBJECT_LOOKUP_METHOD

      Property name to set the default object lookup method during object initialization. As value lower or upper cased enum names are allowed.
      See Also:
        `ObjectLookupMethod`, Constant Field Values

    - #### DATABASE_RETRIEVAL_METHOD

          public static final String DATABASE_RETRIEVAL_METHOD

      Property name to set the default database retrieval method during object initialization. As value lower or upper cased enum names are allowed.
      See Also:
        `DatabaseRetrievalMethod`, Constant Field Values

    - #### AUTOREGISTER_LISTENERS

          public static final String AUTOREGISTER_LISTENERS

      Enable listeners auto registration in Hibernate Annotations and EntityManager. Default to true.
      See Also:
        Constant Field Values

    - #### INDEXING_STRATEGY

          public static final String INDEXING_STRATEGY

      Defines the indexing strategy, default `event` Other options `manual`
      See Also:
        Constant Field Values

    - #### ANALYZER_CLASS

          public static final String ANALYZER_CLASS

      Default Lucene analyser
      See Also:
        Constant Field Values

    - #### ANALYSIS_DEFINITION_PROVIDER

          public static final String ANALYSIS_DEFINITION_PROVIDER

      Provider of default analysis-related definitions for Lucene.

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

      See Also:
        Constant Field Values

    - #### SIMILARITY_CLASS

          public static final String SIMILARITY_CLASS

      Default Lucene similarity
      See Also:
        Constant Field Values

    - #### WORKER_SCOPE

          public static final String WORKER_SCOPE

      See Also:
        Constant Field Values

    - #### WORKER_ENLIST_IN_TRANSACTION

          public static final String WORKER_ENLIST_IN_TRANSACTION

      When set to `true` the indexing operations will be passed to the indexing backend within the transaction. When `false` the indexing backends are invoked as a post-transaction hook. Setting this to `true` is currently only supported when you use the JMS backends exclusively. Defaults to `false`.
      See Also:
        Constant Field Values

    - #### WORKER_PREFIX

          public static final String WORKER_PREFIX

      See Also:
        Constant Field Values

    - #### WORKER_BACKEND

          public static final String WORKER_BACKEND

      See Also:
        Constant Field Values

    - #### WORKER_EXECUTION

          public static final String WORKER_EXECUTION

      See Also:
        Constant Field Values

    - #### QUEUEINGPROCESSOR_BATCHSIZE

          public static final String QUEUEINGPROCESSOR_BATCHSIZE

      Defines the maximum number of indexing operation batched per transaction
      See Also:
        Constant Field Values

    - #### READER_PREFIX

          public static final String READER_PREFIX

      define the reader prefix
      See Also:
        Constant Field Values

    - #### READER_STRATEGY

          public static final String READER_STRATEGY

      define the reader strategy used
      See Also:
        Constant Field Values

    - #### ASYNC_READER_REFRESH_PERIOD_MS

          public static final String ASYNC_READER_REFRESH_PERIOD_MS

      When the "async" reader strategy is enabled queries might be allowed to use a stale read of the index; this property controls how often the indexes are refreshed, in milliseconds. If the refresh operation takes longer than the configured period, the longer time will apply: this is a best-effort limit meant to maximize performance.
      See Also:
        Constant Field Values

    - #### FILTER_CACHING_STRATEGY

          public static final String FILTER_CACHING_STRATEGY

      filter caching strategy class (must have a no-arg constructor and implement FilterCachingStrategy)
      See Also:
        Constant Field Values

    - #### CACHE_DOCIDRESULTS_SIZE

          public static final String CACHE_DOCIDRESULTS_SIZE

      number of docidresults cached in hard reference.
      See Also:
        Constant Field Values

    - #### EXCLUSIVE_INDEX_USE

          public static final String EXCLUSIVE_INDEX_USE

      When set to true a lock on the index will not be released until the SearchIntegrator (or SessionFactory) is closed. This improves performance in applying changes to the index, but no other application can access the index in write mode while Hibernate Search is running. This is an index-scoped property and defaults to false.
      See Also:
        Constant Field Values

    - #### INDEX_METADATA_COMPLETE

          public static final String INDEX_METADATA_COMPLETE

      Boolean setting, defaults to `true`. Unless it's disabled Hibernate Search will assume it knows all entities mapped to this index and will enable all optimizations which are considered safe in the known schema. For example it will delete indexed entities from the index using only the identifier if there is only one type in the index; when multiple types share the same index or this option is disabled it will need to delete entities using both the id and the classname.
      See Also:
        Constant Field Values

    - #### RETRY_MARKER_LOOKUP

          public static final String RETRY_MARKER_LOOKUP

      Number of times we retry the logic looking for marker files in master's directory before giving up and raising an exception. This setting is the suffix of an index using FSSlaveDirectoryProvider

      Note that we try again after 5 seconds.

      Default to 0 (ie no retry).

      See Also:
        Constant Field Values

    - #### SIMILARITY_CLASS_PER_INDEX

          public static final String SIMILARITY_CLASS_PER_INDEX

      Define the similarity class name for a given index
      See Also:
        Constant Field Values

    - #### MODEL_MAPPING

          public static final String MODEL_MAPPING

      Provide a programmatic mapping model to Hibernate Search configuration Accepts a fully populated SearchMapping object or a fully qualified class name of a SearchMapping factory. Such a factory must have: - a no-arg constructor - a method returning SearchMapping and annotated with @Factory
      See Also:
        Constant Field Values

    - #### ERROR_HANDLER

          public static final String ERROR_HANDLER

      Option for specifying an error handler used during processing of the Lucene updates. Supported value types are:
      - `String`: the fully qualified name of an `ErrorHandler` implementation
      - `ErrorHandler`: an error handler instance
      Default is to log errors.
      See Also:
        Constant Field Values

    - #### JMX_ENABLED

          public static final String JMX_ENABLED

      If set to `true` JMX beans get enabled. For all other values the beans do not. get enabled.
      See Also:
        Constant Field Values

    - #### JMX_BEAN_SUFFIX

          public static final String JMX_BEAN_SUFFIX

      If JMX bean deployment is enabled (see `JMX_ENABLED`) the specified suffix will be appended to the registered MBean names. This allows for running multiple apps on the same JVM each which JMX enabled. If not specified only the default names are used.
      See Also:
        Constant Field Values

    - #### GENERATE_STATS

          public static final String GENERATE_STATS

      If set to `true` the search statistic will be gathered.
      See Also:
        Constant Field Values

    - #### LUCENE_MATCH_VERSION

          public static final String LUCENE_MATCH_VERSION

      The Lucene match version parameter. Highly recommended since Lucene 3.
      See Also:
        Constant Field Values

    - #### DEFAULT_NULL_TOKEN

          public static final String DEFAULT_NULL_TOKEN

      Parameter name used to configure the default null token
      See Also:
        Constant Field Values

    - #### ENABLE_DIRTY_CHECK

          public static final String ENABLE_DIRTY_CHECK

      When enabled re-indexing of an entity is skipped if the updates affect only non-indexed fields. Enabled by default as it should be safe and should improve performance, disable it to force updates skipping value checks. Affect semantics of entity updates only.
      See Also:
        Constant Field Values

    - #### MAX_QUEUE_LENGTH

          public static final String MAX_QUEUE_LENGTH

      The lucene backend has a separate writing thread for each index, the work pushed to each thread is put in a queue which grows up to a maximum number of elements, which is configured by this setting and defaults to 1000. When the limit is reached work producers are blocked until some work has been processed.
      See Also:
        Constant Field Values

    - #### INDEX_FLUSH_INTERVAL

          public static final String INDEX_FLUSH_INTERVAL

      The lucene backend can operate in async mode, and can apply changes to the index at regular intervals, effectively collapsing incoming changesets in order to reduce the amount of commits. This property specifies the interval in ms that commits will be done. This property will be ignored unless aync indexing is enabled.
      See Also:
        Constant Field Values

    - #### DEFAULT_LUCENE_MATCH_VERSION

          public static final Version DEFAULT_LUCENE_MATCH_VERSION

      If nothing else is specified we use `Version.LUCENE_CURRENT` as the default Lucene version. This version parameter was introduced by Lucene to attempt providing backwards compatibility when upgrading Lucene versions and not wanting to rebuild the index from scratch. It's highly recommended to specify a version, so that you can upgrade Hibernate Search and control when to eventually upgrade the Lucene format.

    - #### INDEX_MANAGER_IMPL_NAME

          public static final String INDEX_MANAGER_IMPL_NAME

      Used to specify an alternative IndexManager implementation for a specific index. This is an index scoped property, so it needs to be prefixed by default or the index name, for example:
      - hibernate.search.default.indexmanager
      - hibernate.search.Books.indexmanager
      See Also:
        Constant Field Values

    - #### INDEX_NAME_JMS_PROPERTY

          public static final String INDEX_NAME_JMS_PROPERTY

      Name of the JMS message property containing the index name to which to apply remote work. JMSXGroupID is actually a standard JMS header field which is used for message grouping. See HSEARCH-1922.
      See Also:
        Constant Field Values

    - #### LOCKING_STRATEGY

          public static final String LOCKING_STRATEGY

      Option for setting the locking strategy to be used for locking Lucene directories. Supported values are:
      - `simple`
      - `native`
      - `single`
      - `none`
      - The fully-qualified name of a custom `LockFactoryProvider` implementation.
      Can be given globally or for specific indexes:
      - `hibernate.search.default.locking_strategy=simple`
      - `hibernate.search.Books.locking_strategy=org.custom.components.MyLockingFactory`
      See Also:
        Constant Field Values

    - #### INDEX_BASE_PROP_NAME

          public static final String INDEX_BASE_PROP_NAME

      Option for setting the base directory for storing Lucene indexes when working with file-system based directories. To be given globally:

      `hibernate.search.default.indexBase=/var/lucene/indexes`

      See Also:
        Constant Field Values

    - #### INDEX_NAME_PROP_NAME

          public static final String INDEX_NAME_PROP_NAME

      Option for specifying an index name for specific entities. To be given per entity:

      `hibernate.search.com.example.Furniture.indexName=FurnitureIndex`

      See Also:
        Constant Field Values

    - #### INDEX_UNINVERTING_ALLOWED

          public static final String INDEX_UNINVERTING_ALLOWED

      Option for allowing or disallowing index uninverting when sorting on fields not covered by doc value fields. If disallowed and and uncovered sort is detected, an exception will be raised, otherwise only a warning will be logged.

      Allowed values are "true" and "false". Defaults to "false".

      See Also:
        `SortableField`, Constant Field Values

    - #### DEFAULT_SERVICES_MAP

          public static final Map<Class<? extends Service>,String> DEFAULT_SERVICES_MAP

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