[
https://hibernate.onjira.com/browse/HSEARCH-1065?page=com.atlassian.jira....
]
Sylvain Vieujot commented on HSEARCH-1065:
------------------------------------------
Thank you for the comment.
I can live with that for searches on a single field, as it can easily be dealt with
progamaticly.
However, for seaches on multiple fields, this is a real inconvenience :
ftem.getSearchFactory()
.buildQueryBuilder()
.forEntity( TestEntity.class )
.get()
.keyword()
.fuzzy()
.onFields( "text", "testEnum" ) // CRASH HERE
.matching( "Sample" )
.createQuery();
I think the novice understanding is that a full text search matching method should always
accept a String.
Otherwise, it makes searh form parameter processing quite cumbersome.
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