-->
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.  [ 3 posts ] 
Author Message
 Post subject: delete function doesn't work
PostPosted: Fri Nov 20, 2009 10:26 am 
Newbie

Joined: Sat Jun 20, 2009 2:04 pm
Posts: 3
I use hibernate search and auto indexing function. The auto indexing and updating function are fine. but when I use hql to delete an entry in table product(delete from product where id = 4), hibernate search doesn't delete index automatically. So let's say I have 8 entries in product table, after delete one, I still get total 8 entries when i use hibernate search to search. Anybody has any idea on this?

Do I need to do some special thing like adding some annotations?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: delete function doesn't work
PostPosted: Tue Nov 24, 2009 5:22 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
First you should rarely use bulk queries like that.
For example your query can efficiently be replaced by
em.remove ( em.getReference(Product.class, 4) );

But if you have to use a bulk query, then Hibernate Search does not know about the change and you have to "tell it" by using the FullTextEntityManager#index / #purge etc

But again, bulk operations are useful if you really massive bulk changes to your data.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: delete function doesn't work
PostPosted: Wed Nov 25, 2009 3:51 pm 
Newbie

Joined: Sat Jun 20, 2009 2:04 pm
Posts: 3
Thanks for your reply. It's helpful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.