Seeing that this seems to work for so many people, it should be really simple to solve, perhaps someone spots an issue here cause i am really at a loss of what causes it.
So, i am trying to translate an object to string by implementing the FieldBridge interface.
relevant excerpt from bridge
Code:
public void set(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions) {
luceneOptions.addFieldToDocument("document", convert((Document) value), document);
}
annotation
Code:
@Field(index = Index.TOKENIZED, store = Store.NO)
@FieldBridge(impl = DocumentBridge.class)
public Document getDocument() {
return this.document;
}
full-text search
Code:
BooleanQuery query = new BooleanQuery();
...
query.add(qbDocuments.keyword().onField("document").matching(search.getSimpleQuery()).createQuery(), SHOULD);
the indexation goes fine (in order for indexation to happen i have to add the @Field annotation though), i can query the docuemtn in luke.
the query part however yields this error
Code:
org.hibernate.search.SearchException: FieldBridge class ...document.DocumentBridgedoes not have a objectToString method
prior to the FieldBridge implementation I have tried the StringBridge alternative which also ended up with this error:
Code:
FieldBridge class org.hibernate.search.bridge.String2FieldBridgeAdaptordoes not have a objectToString method
I am building this with hibernate-core v.3.6.0.Final and hibernate-search v.3.3.0.Final and hibernate-commons-annotations v.3.2.0.Final and lucene-core v.3.0.3
thanks for any idea on what my problem would be.
--val