Hi,
right the default loading strategy is not appropriate for large result sets.
We expect most use cases to use pagination, as with
Code:
org.hibernate.Query.setMaxResults(int)
org.hibernate.Query.setFirstResult(int)
often used in combination with
Code:
org.hibernate.search.FullTextQuery.getResultSize()
which provides an estimate of the full match size without actually loading them.
If you're sure you need to process all results, did you consider using instead the scrollable API ? because if you're not adding any boundary to the query you might get in out of memory too.
Also have a look into
Code:
org.hibernate.search.FullTextQuery.initializeObjectsWith(ObjectLookupMethod, DatabaseRetrievalMethod)