Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including a list of related entities in the Elasticsearch index #73

Open
preslavrachev opened this issue Feb 7, 2013 · 1 comment
Open

Comments

@preslavrachev
Copy link

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?

@preslavrachev
Copy link
Author

In general, how do I embed related collections of models? I do not really want to ignore them or mark them as FetchType.EAGER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant