Annotation Interface Keyword


@Documented @Target({METHOD,FIELD}) @Retention(RUNTIME) @Repeatable(List.class) @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=KeywordProcessor.class,retrieval=CONSTRUCTOR)) public @interface Keyword
Maps a property to a keyword field in the index, holding a single token (word) of text.

On contrary to Text, this annotation only creates non-tokenized (single-word) text fields. As a result:

  • The field value must be of type String
  • You cannot assign an analyzer when using this annotation
  • You can, however, assign a normalizer (which is an analyzer that doesn't perform tokenization) when using this annotation
  • This annotation allows to make the field sortable

If you want to index a non-String value, use the Basic annotation instead. If you want to index a String value, but want the field to be tokenized, use Text instead.

Simplified version for Infinispan of KeywordField

Since:
14.0
  • Element Details

    • name

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

      String normalizer
      Returns:
      A reference to the normalizer to use for this field. Defaults to an empty string, meaning no normalization at all.
      Default:
      ""
    • norms

      boolean norms
      Returns:
      Whether index time scoring information should be stored or not.
      See Also:
      Default:
      true
    • projectable

      boolean projectable
      Returns:
      Whether projections are enabled for this field.
      See Also:
      Default:
      false
    • sortable

      boolean sortable
      Returns:
      Whether this field should be sortable.
      See Also:
      Default:
      false
    • searchable

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

      boolean aggregable
      Returns:
      Whether aggregations are enabled for this field.
      See Also:
      Default:
      false
    • indexNullAs

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