[
https://hibernate.onjira.com/browse/HSEARCH-1065?page=com.atlassian.jira....
]
Sanne Grinovero commented on HSEARCH-1065:
------------------------------------------
Another solution is:
{code}
.onField( "testEnum" )
.ignoreFieldBridge() <-- !!!
.matching( "TWO" )
{code}
Fuzzy search on Enums crash
---------------------------
Key: HSEARCH-1065
URL:
https://hibernate.onjira.com/browse/HSEARCH-1065
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 4.1.0.CR2
Reporter: Sylvain Vieujot
Assignee: Emmanuel Bernard
Attachments: com.seanergie.persistence.HibernateSearchTest.txt,
HibernateSearchTest.java
I get doing a fuzzy search on an Enum :
query = ftem.getSearchFactory()
.buildQueryBuilder()
.forEntity( TestEntity.class )
.get()
.keyword()
.fuzzy()
.onField( "testEnum" ) // CRASH HERE
.matching( "TWO" )
.createQuery();
I get the following Exception :
org.hibernate.search.bridge.BridgeException: Exception while calling
bridge#objectToString
class: com.seanergie.persistence.HibernateSearchTest$TestEntity
path: testEnum
at
org.hibernate.search.bridge.util.impl.ContextualExceptionBridgeHelper.buildBridgeException(ContextualExceptionBridgeHelper.java:97)
at
org.hibernate.search.bridge.util.impl.ContextualExceptionBridgeHelper$TwoWayConversionContextImpl.objectToString(ContextualExceptionBridgeHelper.java:149)
at
org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.objectToString(DocumentBuilderIndexedEntity.java:370)
at
org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.objectToString(DocumentBuilderIndexedEntity.java:740)
at
org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.buildSearchTerm(ConnectedMultiFieldsTermQueryBuilder.java:141)
at
org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:95)
at
org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:76)
at
com.seanergie.persistence.HibernateSearchTest.testFuzzySearchOnEnum(HibernateSearchTest.java:53)
Code and full stack attached.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira