I have Hibernate Search configured. It creates the indexes and works well with updating the index when an entity is created. However when deleting an entity its values are not removed from the index. Moreover when updating a property it's old value remains in the index (as show through Luke) while the new value is added on top of that.
I assume this is not correct behavior. Can anyone please let me know what is the correct behavior on update delete and if not why is this happening?
In a WAR I'm using:
JBoss 4.2.3 with replaced libraries:
Hibernate Core 3.5.5 (plus all required)
Hibernate-jpa-2.0-api-1.0.0.Final
Hibernate-validator-3.1.0
Hibernate Search 3.1.1 (couldn't get it to work with 3.2.1 due to library conflicts that i could not resolve)
Seam 2.1.2 (removed all Hibernate libs to avoid conflicts).
From persistence.xml:
Code:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="hibernate.default_schema" value="seamschema"/>
<property name="hibernate.archive.autodetection" value="class"/>
<!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<!-- Hibernate Search Configuration -->
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="C:/luceneIndexes"/>
<property name="hibernate.search.analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
<!-- <property name="hibernate.ejb.event.post-insert"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-collection-recreate"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-collection-remove"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-collection-update"
value="org.hibernate.search.event.FullTextIndexEventListener"/>-->
</properties>
I have commented out the listeners as the instructions say they are not needed when using EntityManager.
Thank you,
Dahn