[hibernate-issues] [Hibernate-JIRA] Updated: (HSEARCH-770) Range facets: .below on numeric null values (AssertionFailure: Unsupported range type)

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon Jun 20 04:28:53 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard updated HSEARCH-770:
-------------------------------------

    Fix Version/s: 4.0.0.Alpha1

> Range facets: .below on numeric null values (AssertionFailure: Unsupported range type)
> --------------------------------------------------------------------------------------
>
>                 Key: HSEARCH-770
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-770
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 3.4.0.Final
>         Environment: Using Hibernate 3.4.0 final, independent on on platform.
>            Reporter: Elmer van Chastelet
>             Fix For: 4.0.0.Alpha1
>
>         Attachments: RangeFacetNumericNullValueFail.zip
>
>
> An assertion failure ("Unsupported range type") is thrown, when getting facets ( facetmanager.getFacets( facetName ) ) after narrowing on a facet ( facetmanager.getFacetGroup( facetingName ).selectFacets( facet )) in the following situation:
> - Using a range facet with _.below_ constraint
> - on a _numeric field_ (i.e. has @NumericField annotation)
> - the field has a _null_ value for at least one indexed entity
> Attached is a unit test that throws this exception.
> My guess is that entities with null values are included in the result of the below facet, so probably null is evaluated to be 'lower' than any valid Integer. The lowest value found is probably used somewhere to set some range during .selectFacets( facetName ). This range is then used again when calling .getFacets( facetingName ), which tries to obtain the type from a null value -> AssertionFailure: Unsupported range type.
> RangeFacetNumericNullValueFail.zip includes a unit test (testRangeBelowWithNullValues() in org.hibernate.search.test.query.facet.RangeFacetingTest) and the modified files which are used by this test (like Truck.java)
> Exception trace:
> org.hibernate.annotations.common.AssertionFailure: Unsupported range type
>    at org.hibernate.search.query.dsl.impl.RangeFacetImpl.createNumericRangeQuery(RangeFacetImpl.java:146)
>    at org.hibernate.search.query.dsl.impl.RangeFacetImpl.getFacetQuery(RangeFacetImpl.java:55)
>    at org.hibernate.search.query.engine.impl.FacetManagerImpl.createSelectionGroupQuery(FacetManagerImpl.java:160)
>    at org.hibernate.search.query.engine.impl.FacetManagerImpl.getFacetFilter(FacetManagerImpl.java:146)
>    at org.hibernate.search.query.engine.impl.HSQueryImpl.buildFilters(HSQueryImpl.java:650)
>    at org.hibernate.search.query.engine.impl.HSQueryImpl.getQueryHits(HSQueryImpl.java:384)
>    at org.hibernate.search.query.engine.impl.HSQueryImpl.queryDocumentExtractor(HSQueryImpl.java:275)
>    at org.hibernate.search.query.engine.impl.FacetManagerImpl.getFacets(FacetManagerImpl.java:110)
> See also: [topic in Hibernate user forum|https://forum.hibernate.org/viewtopic.php?f=9&t=1011030]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list