Annotation Type KeywordField
-
@Documented @Target({METHOD,FIELD}) @Retention(RUNTIME) @Repeatable(List.class) @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.KeywordFieldProcessor.class,retrieval=CONSTRUCTOR)) public @interface KeywordField
Maps a property to a keyword field in the index, holding a single token (word) of text.On contrary to
FullTextField
, this annotation only creates non-tokenized (single-word) text fields. As a result:- The field value (the value of your annotated property, or at least the value produced by your custom
value bridge
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
GenericField
annotation instead. If you want to index a String value, but want the field to be tokenized, useFullTextField
instead. - The field value (the value of your annotated property, or at least the value produced by your custom
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Aggregable
aggregable
ContainerExtraction
extraction
String
indexNullAs
String
name
String
normalizer
Norms
norms
Projectable
projectable
Searchable
searchable
Sortable
sortable
ValueBinderRef
valueBinder
ValueBridgeRef
valueBridge
-
-
-
Element Detail
-
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. See the documentation of your backend to know how to define normalization.
- Default:
- ""
-
-
-
projectable
Projectable projectable
- Returns:
- Whether projections are enabled for this field.
- See Also:
GenericField.projectable()
,Projectable
- Default:
- org.hibernate.search.engine.backend.types.Projectable.DEFAULT
-
-
-
sortable
Sortable sortable
- Returns:
- Whether this field should be sortable.
- See Also:
GenericField.sortable()
,Sortable
- Default:
- org.hibernate.search.engine.backend.types.Sortable.DEFAULT
-
-
-
searchable
Searchable searchable
- Returns:
- Whether this field should be searchable.
- See Also:
GenericField.searchable()
,Searchable
- Default:
- org.hibernate.search.engine.backend.types.Searchable.DEFAULT
-
-
-
aggregable
Aggregable aggregable
- Returns:
- Whether aggregations are enabled for this field.
- See Also:
GenericField.aggregable()
,Aggregable
- Default:
- org.hibernate.search.engine.backend.types.Aggregable.DEFAULT
-
-
-
indexNullAs
String indexNullAs
- Returns:
- A value used instead of null values when indexing.
- See Also:
GenericField.indexNullAs()
- Default:
- "__HibernateSearch_indexNullAs_default"
-
-
-
valueBridge
ValueBridgeRef valueBridge
- Returns:
- A reference to the value bridge to use for this field.
Must not be set if
valueBinder()
is set. - See Also:
GenericField.valueBridge()
,ValueBridgeRef
- Default:
- @org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBridgeRef
-
-
-
valueBinder
ValueBinderRef valueBinder
- Returns:
- A reference to the value binder to use for this field.
Must not be set if
valueBridge()
is set. - See Also:
GenericField.valueBinder()
,ValueBinderRef
- Default:
- @org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBinderRef
-
-
-
extraction
ContainerExtraction extraction
- Returns:
- A definition of container extractors to be applied to the property, allowing the binding of a value bridge to container elements. By default, Hibernate Search will try to apply a set of extractors for common container types.
- See Also:
GenericField.extraction()
- Default:
- @org.hibernate.search.mapper.pojo.extractor.mapping.annotation.ContainerExtraction
-
-