# How to embed child classes based on abstract class Id

**URL:** <https://discourse.hibernate.org/t/how-to-embed-child-classes-based-on-abstract-class-id/5674>\
**Category:** Hibernate Search\
**Created:** [September 8, 2021, 10:08am UTC](https://discourse.hibernate.org/t/how-to-embed-child-classes-based-on-abstract-class-id/5674 "2021-09-08T10:08:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [September 8, 2021, 10:18am UTC](https://discourse.hibernate.org/t/how-to-embed-child-classes-based-on-abstract-class-id/5674/3 "2021-09-08T10:18:50Z")

</div>

On second reading, I think you want runtime polymorphism on `@IndexedEmbedded`? If so, then that’s not supported (yet).

See [java - lucene / hibernate search - Cannot search by fields in subclass in collection - Stack Overflow](https://stackoverflow.com/q/56100751/6692043) ; there’s a suggested workaround, but I’m not sure how you would implement it in Search 6. Maybe [@IndexingDependency for abstract Method](https://discourse.hibernate.org/t/indexingdependency-for-abstract-method/4996/) will be relevant to you, too.

---

_[View the full topic](https://discourse.hibernate.org/t/how-to-embed-child-classes-based-on-abstract-class-id/5674)._
