playframework-elasticsearch
playframework-elasticsearch copied to clipboard
Including a list of related entities in the Elasticsearch index
Using the elasticsearch module, is it possible to somehow index the results of a related collection, which is lazy-loaded?
I have a model type Book, which has many Authors, which are lazy loaded
If I annotate the list of authors as @ElasticSearchEmbedded, I get the following exception:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: models.Book.authors, no session or session was closed If I mark it as ignored, of course everything goes fine. Is there a way to at least get the names of the authors in the Book index?
In general, how do I embed related collections of models? I do not really want to ignore them or mark them as FetchType.EAGER