-->
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.  [ 7 posts ] 
Author Message
 Post subject: Removed entities staying in index
PostPosted: Fri Dec 19, 2008 4:22 am 
Newbie

Joined: Tue Sep 23, 2008 10:48 am
Posts: 7
Hi!

Like said in the caption, the problem is that the entities I remove from the database are kept in the index after re-indexing. So when using my search-program, it finds the entities from index but naturally can't show them because they doesn't exist.

After the indexing I also optimize it ( with searchFactory.optimize()).

I need to do the indexing manually so I always make a full indexing. Currently I first have to delete the old index and then run the indexing. This might cause some problems later so I would really like to get rid of this problem.

I've tried to find out what's wrong with my indexing, but I haven't been able to figure out anything. The index is just like it's supposed to when done for the first time (or after removing the old index).

Thanks in advance!

Hibernate 3.2.6
Hibernate Search 3.0.1.GA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2008 4:42 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
how are you removing the entities from your database?
Nobody ever complained about this and I couldn't find a matching issue since version 3.0.1.

Quote:
The index is just like it's supposed to when done for the first time (or after removing the old index).

how do you know this? did you check with Luke or an external program, or through the same application which prepared the index? This could affect it, as some file references could still exist on disk but being ignored by the open Lucene engine.

Quote:
Hibernate Search 3.0.1.GA

In version 3.1.0 a lot of improvements were introduced, could you try that?
You will need to upgrade hibernate core and annotations to latest too.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2008 10:04 am 
Newbie

Joined: Tue Sep 23, 2008 10:48 am
Posts: 7
s.grinovero wrote:
Hi,
how are you removing the entities from your database?
Nobody ever complained about this and I couldn't find a matching issue since version 3.0.1.

Thanks for the quick answer!

And sorry, I meant one database row not entity. I haven't used english with database related things in a while so sorry for the mistake :). So I'm only removing rows from the db but those rows still stay in index after re-indexing and optimize. The db contains a bit less than 10000 rows currently.

Quote:
how do you know this? did you check with Luke or an external program, or through the same application which prepared the index? This could affect it, as some file references could still exist on disk but being ignored by the open Lucene engine.

Yes, I use Luke to check the index. And when using the application, the search finds several matches but some of them doesn't exist anymore. Currently I use different application for the indexing and searching the index. Naturally the hibernate conf is exatctly the same. I used to use the same application for indexing and searching. So currently it is possible that the search finds several hits, but in fact only one of those hits still exist in the db.

Quote:
In version 3.1.0 a lot of improvements were introduced, could you try that?
You will need to upgrade hibernate core and annotations to latest too.

Upgrading the Hibernate core could be a pretty big job at this point. I haven't checked what kind of changes I'd have to make so I'm not sure. But I'll have to look into it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2008 12:04 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Upgrading the Hibernate core could be a pretty big job at this point.

You have only to replace some jars to test this; Of course you'll need to test the whole app too afterwards, but you need that only if you decide to keep the new version, after you've checked this.

I still didn't get how you remove stuff from your DB. You say "rows", you mean you delete them without using hibernate? The index is kept in synch by using hibernate/entitymanager listeners, there's no way if you make changes by other means. In any case Search should't fail if it finds results not found in the DB, so you only need to rebuild the index to cleanup.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 22, 2008 7:07 am 
Newbie

Joined: Tue Sep 23, 2008 10:48 am
Posts: 7
s.grinovero wrote:
Quote:
Upgrading the Hibernate core could be a pretty big job at this point.

You have only to replace some jars to test this; Of course you'll need to test the whole app too afterwards, but you need that only if you decide to keep the new version, after you've checked this.

I guess I'll have to think about testing it at some point.

Quote:
I still didn't get how you remove stuff from your DB. You say "rows", you mean you delete them without using hibernate? The index is kept in synch by using hibernate/entitymanager listeners, there's no way if you make changes by other means. In any case Search should't fail if it finds results not found in the DB, so you only need to rebuild the index to cleanup.

Yes, I dont' use hibernate to delete them. Just normal sql.

The search doesn't really fail. The results just aren't found even though the the search finds them.

But for some reason the deleted rows still show up in the index. Even though I rebuild the index (I build the index manually).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2008 4:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
The search doesn't really fail. The results just aren't found even though the the search finds them.

But for some reason the deleted rows still show up in the index. Even though I rebuild the index (I build the index manually).

I think you should change the way you rebuild your index manually. From your first post I understand you delete the original index, so if the index is deleted and the DB rows are deleted, it doesn't make that they are still found, the only reason can be that you don't restart the persistent context when you delete the files? In that case what is happening is that Search keeps using the deleted files, as nobody told him to close it and the OS isn't forcing this.

Instead of deleting the indexes, did you try using purgeAll on the relevant classes?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 1:59 am 
Newbie

Joined: Tue Sep 23, 2008 10:48 am
Posts: 7
s.grinovero wrote:
Instead of deleting the indexes, did you try using purgeAll on the relevant classes?


No, I didn't. And that just did the trick! Thanks a lot!

This seems like an embarassing easy solution but for some reason I never encountered it elsewhere. Once again, thanks!


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