Package org.hibernate.search.annotations
Annotation Type SortableField
-
@Retention(RUNTIME) @Target({METHOD,FIELD}) @Documented @Deprecated @Repeatable(SortableFields.class) public @interface SortableField
Deprecated.Use Hibernate Search 6's field annotations (GenericField,KeywordField, ...) and enable sorts withinstead. Note that@GenericField(sortable = Sortable.YES)FullTextFieldcannot be marked as sortable, but you can define aKeywordFieldalongside yourFullTextField, with a different name, and that field can be marked as sortable.Makes a property sortable.A field for that property must be declared via the
Fieldannotation from which the field bridge configuration will be inherited. In the rare case that a property should be sortable but not searchable, declare a field which is not indexed nor stored. Then only the sort field will be added to the document, but no standard index field.Sorting on a field without a declared sort field will still work, but it will be slower and cause a higher memory consumption. Therefore it's strongly recommended to declare each required sort field.
- Author:
- Gunnar Morling
-
-
Element Detail
-
forField
String forField
Deprecated.- Returns:
- the name of the field whose field bridge to apply to obtain the value of this sort field. Can be omitted in case only a single field exists for the annotated property.
- Default:
- ""
-
-