org.hibernate.search.annotations

## Annotation Type IndexedEmbedded

-     @Retention(value=RUNTIME)
       @Target(value={FIELD,METHOD})
       @Documented
      public @interface IndexedEmbedded

  Specifies that an association (`@*To*`, `@Embedded`, `@CollectionOfEmbedded`) is to be indexed in the root entity index. This allows queries involving associated objects properties.

- - ### Field Summary

    Fields
    Modifier and Type | Fields and Description
    --- | ---
    `static String` | `DEFAULT_NULL_TOKEN` Value for the `indexNullAs()` parameter indicating that `null` values should be indexed using the null token given through the `Environment.DEFAULT_NULL_TOKEN` configuration property.
    `static String` | `DO_NOT_INDEX_NULL` Default value for the `indexNullAs()` parameter.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `int` | `depth` Stop indexing embedded elements when `depth` is reached.
    `boolean` | `includeEmbeddedObjectId` Returns `true`, if the id of the embedded object should be included into the index, `false` otherwise.
    `String[]` | `includePaths` List which paths of the object graph should be included in the index, and need to match the field names used to store them in the index, so they will also match the field names used to specify full text queries.
    `String` | `indexNullAs` By default, null values are not indexed.
    `String` | `prefix` Field name prefix.
    `Class<?>` | `targetElement` Overrides the target type of an association, in case a collection overrides the type of the collection generics.

- - ### Field Detail

    - #### DO_NOT_INDEX_NULL

          public static final String DO_NOT_INDEX_NULL

      Default value for the `indexNullAs()` parameter. Indicates that `null` values should not be indexed.

  - - #### DEFAULT_NULL_TOKEN

          public static final String DEFAULT_NULL_TOKEN

      Value for the `indexNullAs()` parameter indicating that `null` values should be indexed using the null token given through the `Environment.DEFAULT_NULL_TOKEN` configuration property. If no value is given for that property, the token `_null_` will be used.

  - ### Element Detail

    - #### prefix

          public abstract String prefix

      Field name prefix.
      Returns:
        the field name prefix. Default to ".", indicating that `propertyname.` will be used.
      Default:
        "."

  - - #### includePaths

          public abstract String[] includePaths

      List which paths of the object graph should be included in the index, and need to match the field names used to store them in the index, so they will also match the field names used to specify full text queries.

      Defined paths are going to be indexed even if they exceed the `depth` threshold. When `includePaths` is not empty, the default value for `depth` is 0.

      Defined paths are implicitly prefixed with the `prefix()`.

      Returns:
        the paths to include. Default to empty array
      Default:
        {}

  - - #### depth

          public abstract int depth

      Stop indexing embedded elements when `depth` is reached. `depth=1` means the associated element is indexed, but not its embedded elements.

      The default value depends on the value of the `includePaths` attribute: if no paths are defined, the default is `Integer.MAX_VALUE`; if any `includePaths` are defined, the default `depth` is interpreted as 0 if not specified to a different value than it's default.

      Note that when defining any path to the `includePaths` attribute the default is zero also when explicitly set to `Integer.MAX_VALUE`.

      Returns:
        the depth size. Default value is `Integer.MAX_VALUE`
      Default:
        2147483647

  - - #### targetElement

          public abstract Class<?> targetElement

      Overrides the target type of an association, in case a collection overrides the type of the collection generics.
      Returns:
        the target type of the association. Default to `void.class`
      Default:
        void.class

  - - #### indexNullAs

          public abstract String indexNullAs

      By default, null values are not indexed. Use `indexNullAs()` if you want null values to be indexed.

      If this property is set to something different from the default, null values will be indexed in a field named after the `prefix`, with the trailing dot (if any) removed.

      Returns:
        Returns the value to be used for indexing `null`. Per default `IndexedEmbedded.DO_NOT_INDEX_NULL` is returned indicating that null values are not indexed.
      Default:
        "__DO_NOT_INDEX_NULL__"

  - - #### includeEmbeddedObjectId

          public abstract boolean includeEmbeddedObjectId

      Returns `true`, if the id of the embedded object should be included into the index, `false` otherwise. The default is `false`.

      Note
      : If the id property is explicitly listed via `includePaths()`, then the id is included even if this value is `false`.

      Returns:
        Returns `true`, if the id of the embedded object should be included into the index, `false` otherwise.
      Default:
        false

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