org.hibernate.search.elasticsearch.cfg

## Enum IndexSchemaManagementStrategy

- java.lang.Object
- - java.lang.Enum<IndexSchemaManagementStrategy>
  - - org.hibernate.search.elasticsearch.cfg.IndexSchemaManagementStrategy

- All Implemented Interfaces:
    Serializable, Comparable<IndexSchemaManagementStrategy>

      public enum IndexSchemaManagementStrategy
      extends Enum<IndexSchemaManagementStrategy>

  Strategy for creating/deleting the indexes in Elasticsearch upon session factory initialization and shut-down.
  Author:
    Gunnar Morling

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CREATE` Existing indexes will not be altered, missing indexes will be created along with their mappings and analyzer definitions.
    `DROP_AND_CREATE` Indexes - and all their contents - will be deleted and newly created (along with their mappings and analyzer definitions) upon session factory initialization.
    `DROP_AND_CREATE_AND_DROP` The same as `DROP_AND_CREATE`, but indexes - and all their contents - will be deleted upon session factory shut-down as well.
    `NONE` Indexes will never be created or deleted.
    `UPDATE` Upon session factory initialization, index mappings and analyzer definitions will be updated to match expected ones, causing an exception if a mapping to be updated is not compatible with the expected one.
    `VALIDATE` Upon session factory initialization, existing index mappings will be checked by Hibernate Search, causing an exception if a required mapping does not exist or exists but differs in a non-compatible way (more strict type constraints, for instance), or if an analyzer definition is missing or differs in any way.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getExternalName()`
    `static IndexSchemaManagementStrategy` | `interpretPropertyValue(String propertyValue)`
    `static IndexSchemaManagementStrategy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static IndexSchemaManagementStrategy[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### NONE

          public static final IndexSchemaManagementStrategy NONE

      Indexes will never be created or deleted.

      Hibernate Search will not even check that the index actually exists.

      The index schema (mapping and analyzer definitions) is not managed by Hibernate Search and is not checked.

    - #### VALIDATE

          public static final IndexSchemaManagementStrategy VALIDATE

      Upon session factory initialization, existing index mappings will be checked by Hibernate Search, causing an exception if a required mapping does not exist or exists but differs in a non-compatible way (more strict type constraints, for instance), or if an analyzer definition is missing or differs in any way.

      This strategy will not bring any change to the mappings or analyzer definitions, nor create or delete any index.

    - #### UPDATE

          public static final IndexSchemaManagementStrategy UPDATE

      Upon session factory initialization, index mappings and analyzer definitions will be updated to match expected ones, causing an exception if a mapping to be updated is not compatible with the expected one.

      Missing indexes will be created along with their mappings and analyzer definitions. Missing mappings and analyzer definitions on existing indexes will be created.

    - #### CREATE

          public static final IndexSchemaManagementStrategy CREATE

      Existing indexes will not be altered, missing indexes will be created along with their mappings and analyzer definitions.

    - #### DROP_AND_CREATE

          public static final IndexSchemaManagementStrategy DROP_AND_CREATE

      Indexes - and all their contents - will be deleted and newly created (along with their mappings and analyzer definitions) upon session factory initialization.

      Note that whenever a search factory is altered after initialization (i.e. new entities are mapped), the index will not be deleted again: new mappings will simply be added to the index.

    - #### DROP_AND_CREATE_AND_DROP

          public static final IndexSchemaManagementStrategy DROP_AND_CREATE_AND_DROP

      The same as `DROP_AND_CREATE`, but indexes - and all their contents - will be deleted upon session factory shut-down as well.

  - ### Method Detail

    - #### values

          public static IndexSchemaManagementStrategy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (IndexSchemaManagementStrategy c : IndexSchemaManagementStrategy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static IndexSchemaManagementStrategy valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### interpretPropertyValue

          public static IndexSchemaManagementStrategy interpretPropertyValue(String propertyValue)

    - #### getExternalName

          public String getExternalName()

      Returns:
        the name to use in configuration files.

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