I am using Spring, Hibernate and Hibernate Search in my application.
I need to access Spring context from ClassBridge and from Analyzer. Is it possible?
Code:
@ClassBridge(name="myfield",
index=Index.TOKENIZED,
impl = MyObjClassBridge.class)
@Analyzer(impl = MyAnalyzer.class)
public class MyObj {
...
}
public class MyObjClassBridge implements FieldBridge {
public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
// HOW TO ACCESS SPRING CONTEXT?
}
}
public class MyAnalyzer extends PerFieldAnalyzerWrapper {
// HOW TO ACCESS SPRING CONTEXT?
}