[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-997) Add short numeric bridge

Mathieu Lachance (JIRA) noreply at atlassian.com
Thu Dec 1 10:04:21 EST 2011


Add short numeric bridge
------------------------

                 Key: HSEARCH-997
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-997
             Project: Hibernate Search
          Issue Type: Improvement
          Components: analyzer
    Affects Versions: 4.0.0.Beta2
            Reporter: Mathieu Lachance


when indexing a collection of short value using the @IndexedEmbedded + @NumericField + @Field annotation combinaison, it will return the expected NumericIterableBridge.

though when indexing a short value using the @NumericField + @Field annotation combinaison no bridge is associated with.

here's my understanding of the issue :

when guessing type in org.hibernate.search.bridge.impl.BridgeFactory::guessNumericFieldBridge, it will return null, and then throw an throw new SearchException( "Unable to guess FieldBridge for " + member.getName() ); since there's no ShortNumericBridge type exists.

i guess the correct implementation of the non-existing ShortNumericBridge would be :
public class ShortNumericFieldBridge extends NumericFieldBridge {

	public Object get(String name, Document document) {
		return Short.valueOf(document.getFieldable(name).stringValue());
	}
}

then add we would need to do is add the new implementation into the static numericField map.

seem a nice addition to me, or is there something i missed somewhere ?

thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list