{code} Note that you at the very least need to register the Hibernate Search event listeners before the SessionFactory is created. And I imagine you will have to enable them all the time instead of if they are really needed (a lesser problem I suppose). {code} That part I already have.
{code} Also you need to not have SearchFactory be built upon first use (lazy creation). That would create a decent delay on the first request. {code} I think that works as well. See https://github.com/hferentschik/hibernate-search/tree/HSEARCH-1326. I still need to fix a test, but other than that I think this is doing what we want. The use case for that is boostrapping dynamic sharding. When started the dynamic sharding strategy needs to somehow be able to determine the current shard discriminator values. A prerequisite for that is that the {{ SearchFactory SessionFactory }} is ready and a session can be opened.
|