| Digging this up... The correct sequence of commands when batching works would actually be: `flush();flushToIndexes(); clear(); commit();`. This should prevent any `LazyInitializationException` from happening. Not to say we shouldn't try to detect it automatically and trigger the `flushToIndexes` ourselves, but I thought it could help. See also https://docs.jboss.org/hibernate/search/5.10/reference/en-US/html_single/#search-batchindex-flushtoindexes |