Annotation Type Text


@Documented @Target({METHOD,FIELD}) @Retention(RUNTIME) @Repeatable(List.class) @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=TextProcessor.class,retrieval=CONSTRUCTOR)) public @interface Text
Maps a property to a full-text field in the index, potentially holding multiple tokens (words) of text.

Note that this annotation only creates tokenized (multi-word) text fields. As a result:

  • The field value must be of type String
  • You must assign an analyzer when using this annotation
  • This annotation does not allow making the field sortable (analyzed fields cannot be sorted on)
  • This annotation does not allow making the field aggregable (analyzed fields cannot be aggregated on)

If you want to index a non-String value, use the Basic annotation instead. If you want to index a String value, but don't want the field to be analyzed, or want it to be sortable, use the Keyword annotation instead.

Simplified version for Infinispan of FullTextField

Since:
14.0
  • Element Details

    • name

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

      String analyzer
      Returns:
      A reference to the analyzer to use for this field. By default, the Lucene standard analyzer will be applied.
      Default:
      "standard"
    • searchAnalyzer

      String searchAnalyzer
      Returns:
      A reference to a different analyzer, overriding the analyzer(), to use for query parameters at search time. If not defined, the same analyzer() will be used.
      Default:
      ""
    • norms

      boolean norms
      Whether index-time scoring information for the field should be stored or not.

      Enabling norms will improve the quality of scoring. Disabling norms will reduce the disk space used by the index.

      Returns:
      Whether index-time scoring information should be stored or not.
      Default:
      true
    • termVector

      TermVector termVector
      Returns:
      The term vector storing strategy.
      See Also:
      Default:
      NO
    • projectable

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

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