-->
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: i have to reindex new items!
PostPosted: Tue Dec 01, 2009 11:38 am 
Newbie

Joined: Tue Dec 01, 2009 11:29 am
Posts: 2
hi,
i'm developing a simple application, and i use hibernate annotations 3.4.0 ga and hibernate search 3.1.1 ga.
the annotations part works fine, my pojo classes are succesfully persisted on my db, and i can see that after i call
session.save(mypojoclass) and transaction.commit()
hibernate search updates the index file (i can also check inside it with luke, and see that the new "terms" introduced by the last save are present in the index).
well... after this if i create a fulltext query and i search objects with the terms introduced by the last update on the db... it returns no object at all.
while... if i call the fulltextsession.index on my pojo object i can find it.
what's my mistake?
thx in advance


Top
 Profile  
 
 Post subject: Re: i have to reindex new items!
PostPosted: Tue Dec 01, 2009 2:04 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

if you wouldn't mentioned the fact that the index updates after you insert/update entities I would have said that the event listeners for auto-indexing are not properly enables/configured. But since you are saying that you can see index changes via Luke I am no sure what's going on. Maybe wrong session management?
It would help if you would post your configuration (annotated classes, etc) and your code for indexing/searching.

--Hardy


Top
 Profile  
 
 Post subject: Re: i have to reindex new items!
PostPosted: Wed Dec 02, 2009 7:20 am 
Newbie

Joined: Tue Dec 01, 2009 11:29 am
Posts: 2
i think i found my mistake... i forgot the annotation @GeneratedValue near @Id, so the new pojo instance was indexed with an incorrect Id (0), so the fulltextquery could not find the new object...
thx for your time
airone


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.