MetadataProvidingFieldBridge's metadata is ignored when the metadata concerns an already-existing (Hibernate Search-generated) field. For instance, when a user wants to define a field bridge that will turn a bean to a sortable numeric field, they cannot use the name of the field carrying the field bridge and must hack away by adding a suffix to the sortable numeric field name. That's a shame, because the field generated by Hibernate Search is missing metadata anyway: in particular, even with an @Numeric annotaton, Hibernate Search cannot guess the actual numeric encoding type (int, double, ...) and thus cannot guess the correct sort type in the sort API (see HSEARCH-2325, HSEARCH-1872). |
|