]
Sanne Grinovero updated HSEARCH-744:
------------------------------------
Community Help Wanted: [Yes, please]
NullPointerException when using a range query on a numeric field and
searching for values below a given boundary
-----------------------------------------------------------------------------------------------------------------
Key: HSEARCH-744
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-744
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.0.Final
Environment: Hibernate Core 3.6.3, MySQL 5.1.55
Reporter: Nikita D
Fix For: 3.4.1, 4.0
When using the query API to search for values below a boundary, a NullPointerException is
thrown if the field is a numeric field (annotated with @NumericField). Example query:
{code}
Query luceneQuery = qb
.range()
.onField("myNumericField")
.below(myMaxValue)
.createQuery();
{code}
The problem is in NumericFieldUtils.createNumericRangeQuery(), which always uses the
"from" value to determine the class. For a "below" query, the
"from" value is null.
Stacktrace:
{code}
java.lang.NullPointerException
at
org.hibernate.search.bridge.util.NumericFieldUtils.createNumericRangeQuery(NumericFieldUtils.java:17)
at
org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:104)
at
org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:79)
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: