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 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)}}.
Note: we may have a similar issue with other types of queries (keyword() in particular). |
|