Enum Class ValueModel

java.lang.Object
java.lang.Enum<ValueModel>
org.hibernate.search.engine.search.common.ValueModel
All Implemented Interfaces:
Serializable, Comparable<ValueModel>, Constable

public enum ValueModel extends Enum<ValueModel>
Defines the expectations on how the values passed to the Search DSL and returned back are represented.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    This constant is deprecated and will be removed at the same time as the ValueConvert enum is removed.
    This model does not apply conversion and allows working with the types as defined on the index side.
    This is the default model that allows working with the types as defined on the entity side.
    This model does not apply conversion and allows working with the types that the backend operates with on a low level.
    This model applies formatting and parsing allowing working with the string representation of values.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ValueModel
    Returns the enum constant of this class with the specified name.
    static ValueModel[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • MAPPING

      public static final ValueModel MAPPING
      This is the default model that allows working with the types as defined on the entity side.

      For field values passed to the DSL (for example the parameter of a match predicate), the DSL converter defined in the mapping will be used. This generally means values passed to the DSL will be expected to have the same type as the entity property used to populate the index field.

      For identifier values passed to the DSL (for example the parameter of an ID predicate), the identifier converter defined in the mapping will be used. This generally means values passed to the DSL will be expected to have the same type as the entity property used to generate document identifiers.

      For fields values returned by the backend (for example in projections), the projection converter defined in the mapping will be used. This generally means the projected values will have the same type as the entity property used to populate the index field.

      If no converter was defined in the mapping, this option won't have any effect.

      Please refer to the reference documentation for more information.

    • INDEX

      public static final ValueModel INDEX
      This model does not apply conversion and allows working with the types as defined on the index side.

      For field values passed to the DSL (for example the parameter of a match predicate), no converter will be used. This generally means values passed to the DSL will be expected to have the same type as the index field.

      For identifier values passed to the DSL (for example the parameter of an ID predicate), no converter will be used. This means values passed to the DSL will be expected to be strings that match document identifiers exactly.

      For fields values returned by the backend (for example in projections), no converter will be used. This generally means the projected values will have the same type as the index field.

      Please refer to the reference documentation for more information.

    • STRING

      @Incubating public static final ValueModel STRING
      This model applies formatting and parsing allowing working with the string representation of values.

      For string values passed to the DSL (for example the parameter of a match predicate), the parser converter defined in the mapping will be used. This generally means strings passed to the DSL will be expected to be formatted in a way that parsing of them can be done in the same way as indexing-null-as parsing is performed.

      For identifier values passed to the DSL (for example the parameter of an ID predicate), the identifier parser converter defined in the mapping will be used.

      For fields values returned by the backend (for example in projections), the IndexFieldTypeConverterStep.formatter(FromDocumentValueConverter) formatter} defined in the mapping will be used. This generally means the projected values will be strings that can be parsed back via the parser converter.

      Please refer to the reference documentation for more information.

    • RAW

      @Incubating public static final ValueModel RAW
      This model does not apply conversion and allows working with the types that the backend operates with on a low level.

      The values are passed straight to the backend as is. Conversion is disabled. Any encoding and decoding is also disabled.

      For field values passed to the DSL (for example the parameter of a match predicate), no converter will be used. This generally means values passed to the DSL will be expected to have the same type as the type that backend uses to represent the index field.

      For identifier values passed to the DSL (for example the parameter of an ID predicate), no converter will be used. This means values passed to the DSL will be expected to be strings that match document identifiers exactly.

      For fields values returned by the backend (for example in projections), no converter will be used. This generally means the projected values will have the same type as the type that backend uses to represent the index field.

      Requesting a raw value model representation requires working with backend specific types which are dependent on a particular backend implementation, hence these types are not guaranteed to be stable, and may change in the future.

      Please refer to the reference documentation for more information.

    • DEFAULT

      @Deprecated(forRemoval=true) public static final ValueModel DEFAULT
      Deprecated, for removal: This API element is subject to removal in a future version.
      This constant is deprecated and will be removed at the same time as the ValueConvert enum is removed. Do not use this value explicitly.
      The result of applying this constant is the same as MAPPING.

      The constant is only available to ease migration from the ValueConvert enum, and will be removed in the future.

  • Method Details

    • values

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

      public static ValueModel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null