|
There is a difference to numeric fields. In that case @Field represents an actual index field. @NumericField only fine-tunes the configuration of that field (its type). So the following represents the configuration of one field in the index:
@Field
@NumericField
int age;
Whereas for sorting another "doc value field" will be added. So the following represents two fields in the index:
@Field
@SortableField
int age;
The sortable field inherits its configuration from the regular index field. Now in the case that a property should be sortable but not searchable, we still need the @Field so we can get its configuration. So the following again would only represent one field in the index:
@Field(stored=Store.NO, indexed=Index.NO)
@SortableField
int age;
That'd be avoided by extending @SortableField itself so one can write it like that:
|