Annotation Interface Sortable


Marker annotation on fields and getters that indicates that a property is to be used for sorting and filtering.

Use this annotation if you want to filter documents fast using a BetweenConstraint or when you want to sort documents in a collection on something else than the default document time range.

The index value is determined as follows:

1) in case the object is null or a blank string the index is ignored;

2) in case the object is a collection, an index is created for the maximum value of the collection elements (use getter if you need one for the minimum value too);

3) in case the object is a map, facets are created for each of the map values. Keys of the map are appended to the property name (including a delimiting slash);

4) in case the class of the element is annotated with Sortable, the toString() value of the element is used;

5) in case the object is a constant value (number, string or boolean) the element is used as is;

6) for other values, nested indexes are collected by inspecting all annotated properties of the object. If the object contains any indexed values these will be included as well. Names of nested indexes will be appended to the parent property name (including a delimiting slash);

7) in other cases the toString() value of the element is used.

Note that placing this annotation on a property while there are already documents in the collection, will not automatically make sure the existing documents get retroactively indexed. See @HandleDocument if you need that.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional argument that defines the name of the indexed property.
  • Element Details

    • value

      String value
      Optional argument that defines the name of the indexed property. If left empty, the property name will be used.
      Default:
      ""