Change By: Hardy Ferentschik (07/Jan/13 5:42 AM)
Description: I have an indexed entity with a field mapped like this :
{code}
@Column(name ="DOC_PATH")
@Field
@TikaBridge
private String docPath;
{code}

docPath references a pdf text file for the entity.

I have indexed the entities with a massindexer and am able to search fine through luke, the pdf are well indexed.

While trying to search through hibernate search, I encounter the following problem :

The code for the search is :
{code}
QueryBuilder DIInQB = ftSession.getSearchFactory().buildQueryBuilder().forEntity(IndexedEntityWithPdf.class ).get();

Query diInLuceneQuery = DIInQB.keyword().
                onField("docPath").
                matching(s.toLowerCase()).createQuery();
{code}

The code returns an exception which is thrown on the creation of the query, with the following cause :

{noformat}
Caused by: org.hibernate.search.SearchException: FieldBridge class org.hibernate.search.bridge.builtin.TikaBridge does not have a objectToString method: field docPath in com.viris.entity.indicateur_entities.IndexedEntityWithPdf

                at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.objectToString(DocumentBuilderIndexedEntity.java:749)

                at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.buildSearchTerm(ConnectedMultiFieldsTermQueryBuilder.java:146)

                at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:100)

                at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:81)

                at com.viris.view.Search.SearchAppPage.search(SearchAppPage.java:132)
{noformat}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira