We do this:
{code} DocumentFieldMetadata fieldMetadata = documentBuilder.getTypeMetadata().getDocumentFieldMetadataFor( fieldName ); if ( fieldMetadata != null ) { if ( fieldMetadata.isNumeric() ) { perFieldQuery = createNumericRangeQuery( fieldName, rangeContext ); } else { perFieldQuery = createKeywordRangeQuery( fieldName, rangeContext, queryContext, conversionContext, fieldContext ); } } {code}
Thus, if there is a custom MetadataProvidingFieldBridge that overrides the field type for its default field, we completely ignore this the override (we only check DocumentFieldMetadata, which is only about @NumericField and whether the field bridge implements EncodingBridge) . Maybe the simplest solution would be to take the output of MetadataProvidingFieldBridge into account when setting the value of DocumentFieldMetadata.isNumeric()... ? See {{org.hibernate.search.engine.metadata.impl.AnnotationMetadataProvider.isNumericField(NumericField, FieldBridge)}}. |
|