-->
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.  [ 4 posts ] 
Author Message
 Post subject: HibernateSearch: Store more than one class in one index
PostPosted: Mon Nov 03, 2008 12:55 pm 
Newbie

Joined: Mon Nov 03, 2008 12:27 pm
Posts: 5
Hi all,
I would like to store in one index the data of many classes. I wrote a specific class bridge to do this on the main class (Bibnnotice) who refererence other classes. Also I would like to update this index when a referenced class is updated (Bibntitre). I don't want that referenced class
store own data in her own index.
My problem, if I use @ContainedIn annotation on bibnnotice attribute in Bibntitre and I don't add @indexed on Bibntitre, a modification on Bibntitre instance not update Bibnnotice index. Also I don't want to use @IndexEmbedded on my bibntitres attribute, because I do a treatment on data stored.
See a piece of source code below:

Code:
@Entity
@Table(name="BIB_N_NOTICE")
@Indexed
@ClassBridge(name="noticeIndexation",
        index=Index.TOKENIZED,
        store=Store.YES,
        impl = BibnnoticeIndexationClassBridge.class)
public class Bibnnotice extends AfiHomeAnnotations implements java.io.Serializable
{
    @DocumentId
     private Integer id;
     
     //@IndexedEmbedded
     private Set<Bibntitre> bibntitres = new HashSet<Bibntitre>(0);
....
}@Entity
@Table(name = "BIB_N_TITRE")
@Indexed
public class Bibntitre extends AfiHomeAnnotations implements java.io.Serializable {
  //@DocumentId
   private Integer id;
  @ContainedIn
  private Bibnnotice bibnnotice;
...
}


Thanks for an help.
JPP


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 4:37 am 
Newbie

Joined: Mon Nov 03, 2008 12:27 pm
Posts: 5
To resume, I would like a mechanism that update Bibnnotice data in index when a Bibntitre is created,updated without indexing Bibntitre data.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 11:29 am 
Hibernate Team
Hibernate Team

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

I am not quite sure I understand everything correctly. Generally, you should be able to use @indexedEmbedded and @ContainedIn without annotating Bibntitre with @Indexed. Which version of Hibernate Search are you using and what does not work if you leave out the @Indexed anotation?

Why do you not want to use the @IndexedEmbedded annotation? Can you explain this in more detail. I don't understand why using this annotation should cause a problem.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 12:26 pm 
Newbie

Joined: Mon Nov 03, 2008 12:27 pm
Posts: 5
I have just look for response to my post (I thought I will receive an email when a response will be post).

Now I try an other solution to index my data, because of null pointer exception and the long time for indexation process.
I have created a subclass of FullTextIndexEventListener and I load data to index from database by criteria to reduce time. I create lucene Document manually.

Thanks for your response
JPP


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