-->
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.  [ 6 posts ] 
Author Message
 Post subject: Index alternative entity.
PostPosted: Sat Apr 24, 2010 4:21 am 
Newbie

Joined: Sat Apr 24, 2010 4:18 am
Posts: 4
I was just wondering what is the best way, i.e. the best place, to implement indexing of a different entity when an index of another entity is triggered.

For example:

Say Object1 had changed and was set to be indexed but instead of indexing Object1 I index Object2.

Any help would be greatly appreciated.


Top
 Profile  
 
 Post subject: Re: Index alternative entity.
PostPosted: Sat Apr 24, 2010 8:46 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
I'm confused, why would you like to index an object which didn't change?

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


Top
 Profile  
 
 Post subject: Re: Index alternative entity.
PostPosted: Sat Apr 24, 2010 9:38 am 
Newbie

Joined: Sat Apr 24, 2010 4:18 am
Posts: 4
Thanks for replying :)

I am trying to index an object that represents a view that contains the data that has changed.

This gives me the best performance in terms of indexing and I also don't have the complications involved with embedded indexes and it contained in counterpart.

I was thinking that maybe I could override the listener and when class of object that had changed was of type Object1.class I could just pass in the Object2.class. But is there a better way? I read in another of your posts that FullText..EventListener is going to become final, the comments say this as well, so overriding it is not the best idea.

Is there another point, a better point, I could extend Hibernate Search to accomplish this?


Top
 Profile  
 
 Post subject: Re: Index alternative entity.
PostPosted: Sat Apr 24, 2010 11:01 am 
Newbie

Joined: Sat Apr 24, 2010 4:18 am
Posts: 4
Or would it be better to create a custom Worker?


Top
 Profile  
 
 Post subject: Re: Index alternative entity.
PostPosted: Mon Apr 26, 2010 12:21 am 
Newbie

Joined: Sat Apr 24, 2010 4:18 am
Posts: 4
If anyone can offer a suggestion I will go away try it and report back.. Please :)


Top
 Profile  
 
 Post subject: Re: Index alternative entity.
PostPosted: Mon Apr 26, 2010 2:05 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello, you could try to use a custom JPA entitylistener, you don't need to extend Search's implementation, and then load your view-entity and send the additional work to the backend. I didn't try it, feedback welcome ;)

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


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