org.hibernate.search.annotations

## Annotation Type Field

-     @Retention(value=RUNTIME)
       @Target(value={METHOD,FIELD})
       @Documented
       @Repeatable(value=Fields.class)
      public @interface Field

  Annotation used for marking a property as indexable.
  Author:
    Emmanuel Bernard, Hardy Ferentschik

- - ### 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
    --- | ---
    `Analyze` | `analyze`
    `Analyzer` | `analyzer`
    `Boost` | `boost` Deprecated. Index-time boosting will not be possible anymore starting from Lucene 7. You should use query-time boosting instead, for instance by calling `boostedTo(float)` when building queries with the Hibernate Search query DSL.
    `FieldBridge` | `bridge`
    `Index` | `index`
    `String` | `indexNullAs`
    `String` | `name`
    `Normalizer` | `normalizer`
    `Norms` | `norms`
    `Store` | `store`
    `TermVector` | `termVector`

- - ### 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

    - #### name

          public abstract String name

      Returns:
        Returns the field name. Defaults to the JavaBean property name.
      Default:
        ""

  - - #### store

          public abstract Store store

      Returns:
        Returns a `Store` enum type indicating whether the value should be stored in the document. Defaults to `Store.NO`.
      Default:
        org.hibernate.search.annotations.Store.NO

  - - #### index

          public abstract Index index

      Returns:
        Returns a `Index` enum defining whether the value should be indexed or not. Defaults to `Index.YES`.
      Default:
        org.hibernate.search.annotations.Index.YES

  - - #### analyze

          public abstract Analyze analyze

      Returns:
        Returns a `Analyze` enum defining whether the value should be analyzed or not. Defaults to `Analyze.YES`.
      Default:
        org.hibernate.search.annotations.Analyze.YES

  - - #### norms

          public abstract Norms norms

      Returns:
        Returns a `Norms` enum defining whether the norms should be stored in the index or not. Defaults to `Norms.YES`.
      Default:
        org.hibernate.search.annotations.Norms.YES

  - - #### termVector

          public abstract TermVector termVector

      Returns:
        Returns a `TermVector` enum defining if and how term vectors are stored. Defaults to `TermVector.NO`.
      Default:
        org.hibernate.search.annotations.TermVector.NO

  - - #### analyzer

          public abstract Analyzer analyzer

      Returns:
        Returns the analyzer for the field. Defaults to the inherited analyzer. Must be empty if `normalizer()` is used.
      Default:
        @org.hibernate.search.annotations.Analyzer

  - - #### normalizer

          public abstract Normalizer normalizer

      Returns:
        Returns the normalizer for the field. Defaults to none. Must be empty if `analyzer()` is used.
      Default:
        @org.hibernate.search.annotations.Normalizer

  - - #### boost

          @Deprecated
          public abstract Boost boost

      Deprecated. Index-time boosting will not be possible anymore starting from Lucene 7. You should use query-time boosting instead, for instance by calling `boostedTo(float)` when building queries with the Hibernate Search query DSL.
      Returns:
        Returns the boost factor for the field. Default boost factor is 1.0.
      Default:
        @org.hibernate.search.annotations.Boost(1.0f)

  - - #### bridge

          public abstract FieldBridge bridge

      Returns:
        Returns the field bridge used for this field. Default is auto-wired.
      Default:
        @org.hibernate.search.annotations.FieldBridge

  - - #### indexNullAs

          public abstract String indexNullAs

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

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