-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Search doesn't update the index on delete
PostPosted: Thu Aug 26, 2010 5:26 pm 
Newbie

Joined: Tue Aug 24, 2010 1:49 pm
Posts: 4
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


Top
 Profile  
 
 Post subject: Re: Hibernate Search doesn't update the index on delete
PostPosted: Mon Aug 30, 2010 8:54 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Have you only used Luke or do Search queries also return entities which you already deleted? Have you turned on Hibernate Search trace level logging? If so you should be seeing trace output from DeleteWorkDelegate showing you whether the entities get deleted from the index.
If all fails you can post your entity code together with the code within a session.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.