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 with @GenericField(sortable = Sortable.YES) instead. Note that FullTextField cannot be marked as sortable, but you can define a KeywordField alongside your FullTextField, 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 Field annotation 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
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String forField
      Deprecated.
       
    • 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:
        ""