java.lang.Object
java.lang.Enum<ReindexOnUpdate>
org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate
All Implemented Interfaces:
Serializable, Comparable<ReindexOnUpdate>

public enum ReindexOnUpdate extends Enum<ReindexOnUpdate>
Defines the impact that an update to a value in an entity will have on reindexing of this entity and containing entities.

A "value" here means either an entity property or something extracted from that property using a ContainerExtractor.

  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Default behavior: updates to the targeted value will trigger automatic reindexing if it's actually used in the indexing process of an indexed entity, unless a property on the path from the indexed entity to the targeted value prevents it through a different ReindexOnUpdate setting.
    Updates to the targeted value, or to any "nested" value (values that are accessed through the targeted value), will never trigger automatic reindexing.
    Updates to the targeted value will trigger automatic reindexing if it's actually used in the indexing process of an indexed entity, unless a property on the path from the indexed entity to the targeted value prevents it through a different ReindexOnUpdate setting.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    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 Details

    • DEFAULT

      public static final ReindexOnUpdate DEFAULT
      Default behavior: updates to the targeted value will trigger automatic reindexing if it's actually used in the indexing process of an indexed entity, unless a property on the path from the indexed entity to the targeted value prevents it through a different ReindexOnUpdate setting.

      To be precise:

      • If an indexed entity accesses the targeted value indirectly (e.g. through an @IndexedEmbedded), and a property in the path from the indexed entity to the targeted value was assigned NO, then updates to the targeted value will not automatically trigger reindexing of the indexed entity.
      • If an indexed entity A accesses the targeted value indirectly (e.g. through an @IndexedEmbedded), and a property in the path from the indexed entity to the targeted value was assigned SHALLOW, and the targeted value is owned by a different entity B, then updates to the targeted value will not automatically trigger reindexing of the indexed entity A.
      • Otherwise, assuming the targeted value is actually used in the indexing process of an indexed entity, either directly (e.g. @GenericField) or indirectly (e.g. through @IndexedEmbedded), then updates to the targeted value will automatically trigger reindexing of the indexed entity.
    • SHALLOW

      public static final ReindexOnUpdate SHALLOW
      Updates to the targeted value will trigger automatic reindexing if it's actually used in the indexing process of an indexed entity, unless a property on the path from the indexed entity to the targeted value prevents it through a different ReindexOnUpdate setting.

      However, updates to "nested" values (values that are accessed through the targeted value) will only trigger automatic reindexing if the "nested" value is owned by the same entity as the targeted value. When the path from the targeted value to the "nested" values crosses entity boundaries, the reindex-on-update behavior automatically switches to NO.

      Applications relying on this setting should have periodic batch processes in place to refresh the index of affected entities in case "nested" values changed.

    • NO

      public static final ReindexOnUpdate NO
      Updates to the targeted value, or to any "nested" value (values that are accessed through the targeted value), will never trigger automatic reindexing.

      Applications relying on this setting should have periodic batch processes in place to refresh the index of affected entities in case the targeted value changed.

  • Method Details

    • values

      public static ReindexOnUpdate[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ReindexOnUpdate 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