Annotation Type Basic


@Documented @Target({METHOD,FIELD}) @Retention(RUNTIME) @Repeatable(List.class) @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=BasicProcessor.class,retrieval=CONSTRUCTOR)) public @interface Basic
Maps an entity property to a field in the index.

This is a generic annotation that will work for any standard field type: String, Integer, LocalDate, ...

Note that this annotation, being generic, does not offer configuration options that are specific to only some types of fields. Use more specific annotations if you want that kind of configuration. For example, to define a tokenized (multi-word) text field, use Text. To define a non-tokenized (single-word), but normalized (lowercased, ...) text field, use Keyword.

Simplified version for Infinispan of GenericField

Since:
14.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the field can be used in aggregations.
     
     
    boolean
    Whether we want to be able to obtain the value of the field as a projection.
    boolean
    Whether we want to be able to search the document using this field.
    boolean
    Whether a field can be used in sorts.
  • Element Details

    • name

      String name
      Returns:
      The name of the index field.
      Default:
      ""
    • projectable

      boolean projectable
      Whether we want to be able to obtain the value of the field as a projection.

      This usually means that the field will be stored in the index, but it is more subtle than that, for instance in the case of projection by distance.

      Returns:
      Whether projections are enabled for this field.
      Default:
      false
    • sortable

      boolean sortable
      Whether a field can be used in sorts.
      Returns:
      Whether this field should be sortable.
      Default:
      false
    • searchable

      boolean searchable
      Whether we want to be able to search the document using this field.

      If the field is not searchable, search predicates cannot be applied to it.

      Returns:
      Whether this field should be searchable.
      Default:
      true
    • aggregable

      boolean aggregable
      Whether the field can be used in aggregations.

      This usually means that the field will have doc-values stored in the index.

      Returns:
      Whether aggregations are enabled for this field.
      Default:
      false
    • indexNullAs

      String indexNullAs
      Returns:
      A value used instead of null values when indexing.
      Default:
      "__Infinispan_indexNullAs_doNotIndexNull"