-->
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: Problem indexing associated entities and sub classes
PostPosted: Mon Oct 05, 2009 1:07 pm 
Newbie

Joined: Mon Oct 05, 2009 8:18 am
Posts: 2
Hi,

I'm new to Hibernate Search and Lucene and just run into a problem with indexing associated entities and sub classes.


Here the simplified domain model:
Code:
@Indexed
class A {
  @IndexEmbedded
  Set<C> setC;
  ...
  // some indexed properties
}

abstract class B {
  @IndexEmbedded
  D classD;
}

class C extends B {
  @ContainedIn
  A classA;
}

class D {
  @ContainedIn
  Set<B> setB; 

  @Field
  String name;
}


Class A contains several class C objects.
Class C is a subclass of class B.
Class B contains a reference to class D.
Class D contains a field (name) we want to index.

If we update an existing class C object everything works fine. But if we add or remove one class C object, the index isn't updated. Ok, the index is updated as we can see in the log, but the added/removed object is not included.
If we add two class C objects to a class A object, the first one is added to the index but the second not. So it just seems that the last one added is missing. Although it is in the database. If we add now another object the second one is indexed. It looks like the class A object that is used for indexing is not updated correctly (doesn't contain the reference to the added class C object).
We first thought that some Listener might not get the add event, but we added org.hibernate.search.backend.impl.lucene.works.AddWorkDelegate in Trace mode to our log and the index for the corresponding class A object is updated, but without the added object.

Does someone have an idea on this? Am I missing something? If you need more information please let me know.
Thanks in advance!


Versions:
Spring 2.5.6.SEC01
hibernate-core 3.3.1.GA
hibernate-annotations 3.4.0.GA
hibernate-search 3.1.0.GA


Top
 Profile  
 
 Post subject: Re: Problem indexing associated entities and sub classes
PostPosted: Wed Oct 07, 2009 3:33 pm 
Newbie

Joined: Mon Oct 05, 2009 8:18 am
Posts: 2
No one an idea?


Top
 Profile  
 
 Post subject: Re: Problem indexing associated entities and sub classes
PostPosted: Thu Oct 08, 2009 3:12 am 
Hibernate Team
Hibernate Team

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

since you are using a two level @IndexedEmbedded setup my first guess would have been that you hit the bug described here - viewtopic.php?f=9&t=998709

However, your description of the problem is not quite what I would expect in this case. Anyways, the bug is fixed. Maybe it's worth to try whether your problems is solved with the latest trunk version of Search. Try placing an @Indexed on class C. This was a workaround for the described bug before it was fixed. If it works then you might be on the right track.

--Hardy


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.