I noticed by chance that the PaginationHibernateIndexEntitiesIndexer doesn't consider second-level caching during indexing. Because of this it could potentially fill up the second-level cache with the complete object model while indexing.
I suggest either setting session.setCacheMode(CacheMode.IGNORE) or session.setCacheMode(CacheMode.GET) before starting the indexing.
Description
I noticed by chance that the PaginationHibernateIndexEntitiesIndexer doesn't consider second-level caching during indexing. Because of this it could potentially fill up the second-level cache with the complete object model while indexing.
I suggest either setting session.setCacheMode(CacheMode.IGNORE) or session.setCacheMode(CacheMode.GET) before starting the indexing.