Search with Multiple Persistence Units and index locations

I have a legacy project with multiple persistence units. Some XA some regular. Some reference the same orm.xml, others a different orm.xml.

Using Hibernate Search 4.5.3.

I’m seeing a lot these during deployment:

Starting sync consumer thread for index …

For PUs that are NOT related to that DB or PU. In fact, I’ve set this in the PUs not using search:

<property name="hibernate.search.enabled" value="false" />

I hope they can be ignored, or are they a sign of something wrong? Like more than one writer thread/class?

Also, the Lucene index folders are -initially- getting created in the wrong place, even though I have this set:

<property name="hibernate.search.jmx_enabled" value="true" />
<property name="hibernate.search.default.directory_provider" value="filesystem" />
<property name="hibernate.search.default.indexBase" value="/indexes/class" />

as well as:

-Dhibernate.search.backend.directory.root=/indexes/class

Am I missing something?

Hi @arnieAustin

4.5 is a pretty old version… I’m not sure whether hibernate.search.enabled is an option for this version or not (at least I don’t see it in the docs)… looking at the docs here: Hibernate Search

The good news is that Hibernate Search is enabled out of the box when detected on the classpath by Hibernate Core. If, for some reason you need to disable it, set hibernate.search.autoregister_listeners to false. Note that there is no performance penalty when the listeners are enabled but no entities are annotated as indexed.

maybe you should try hibernate.search.autoregister_listeners instead?

DOH! Forgot about the version differences. Will add and test.

Thanks!