I think the @IndexedEmbedded might work because all the metadata for the index should be present with the abstract method?
public abstact class A {
@GenericField
public abstract String value();
I’m not asking Hibernate Seach to pick up any new possible fields of I1 or I2 (like the additional childName of [HSEARCH-438] Support runtime polymorphism on associations (instead of defining the indexed properties based on the returned type) - Hibernate JIRA), but just the ones i explictly require in the base class.
Im going to try that once i have my model complete and can run some searches.
Edit: Tested it and currently does not work: Just as yrodiere said, once the abstract class is used in @IndexedEmbedded Hibernate Search again wants to check it and is not able to discover all derivedFroms.
The error is:
Hibernate ORM mapping:
type 'I1':
failures:
- HSEARCH800007: Unable to resolve path '.value' to a persisted attribute in Hibernate ORM metadata. If this path points to a transient attribute, use @IndexingDependency(derivedFrom = ...) to specify which persisted attributes it is derived from. See the reference documentation for more information.
type 'I2':
failures:
- HSEARCH800007: Unable to resolve path '.value' to a persisted attribute in Hibernate ORM metadata. If this path points to a transient attribute, use @IndexingDependency(derivedFrom = ...) to specify which persisted attributes it is derived from. See the reference documentation for more information.