-->
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.  [ 5 posts ] 
Author Message
 Post subject: Can I custom my own FullTextIndexEventListener?
PostPosted: Wed Jan 07, 2009 5:58 am 
Newbie

Joined: Sat Jul 01, 2006 9:38 pm
Posts: 17
Because of the requirements, I need to filter some entities to not indexed with insert event. So I custom an eventListener to implement PostInsertEventListener, but the following exception occured:
Code:
Caused by: org.hibernate.HibernateException: Hibernate Search Event listeners not configured, please check the reference documentation and the application's hibernate.cfg.xml
   at org.hibernate.search.util.ContextHelper.getSearchFactoryBySFI(ContextHelper.java:32)


But if I extends FullTextIndexEventListener, the exception disappeared.

How can I do this? Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 7:53 am 
Hibernate Team
Hibernate Team

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

given the way ContextHelper is implemented you will have to extend FullTextIndexEventListener. The helper class checks for a instance of FullTextIndexEventListener to get hold of the search factory. What's the problem with extending FullTextIndexEventListener? Or maybe you can describe your usecase a little more. There might be a better solution for your problem.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 9:51 am 
Newbie

Joined: Sat Jul 01, 2006 9:38 pm
Posts: 17
Thank you for instant reply.
Yes, I extend the FullTextIndexEventListener now, but I see the TODOs on that class which says this class will be make final in future. I'm afraid there will be any problem after next release.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 22, 2009 7:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
yes there may be some problems in the future, but it's still not decided if it will be a final class. It makes other code simpler, but we should be able to manage conditions like this.

You need a new feature to define a boolean property which "excludes" an instance from index processing?

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2009 10:03 am 
Newbie

Joined: Mon Oct 22, 2007 7:04 am
Posts: 19
A need for the some kind of of "conditional indexing" is expressed in this thread also: [url]http://forum.hibernate.org/viewtopic.php?t=984023&highlight=conditional+indexing
[/url]


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