-->
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: [SEARCH] DynamicBoost not invoked
PostPosted: Tue May 03, 2011 10:15 am 
Newbie

Joined: Mon Jun 22, 2009 12:20 pm
Posts: 4
Hi all,

I've setup a project with Hibernate Search 3.4 containing the following class:

Code:
@Entity
@Indexed
@AnalyzerDefs( {....})
@DynamicBoost(impl=ProductBooster.class)
public class ProductResult {.....


ProductBooster looks like this:
Code:
public class ProductBooster implements BoostStrategy {

   public ProductBooster() {
   }

   public float defineBoost(Object in) {
      ProductResult pr = (ProductResult) in;
      if (pr.isSpecial()) {
         return 10f;
      } else {
         return 1f;
      }
   }

}


My problem is, that defineBoost is never invoked (I put a breakpoint on it) and so the lucene index does not reflect the boost at all.

Has DynamicBoost to be enabled somewhere? Or do you have any other hint what goes wrong here?

Thanks,
Titus


Top
 Profile  
 
 Post subject: Re: [SEARCH] DynamicBoost not invoked
PostPosted: Fri May 06, 2011 4:45 am 
Hibernate Team
Hibernate Team

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

I just checked our DynamicBoostingTest again and it works fine. The dynamic boost gets called on class and attribute level. Are you sure that you are actually indexing a ProductResult? Maybe you could post the indexing code?

--Hardy


Top
 Profile  
 
 Post subject: SOLVED [SEARCH] DynamicBoost not invoked
PostPosted: Mon May 09, 2011 7:42 am 
Newbie

Joined: Mon Jun 22, 2009 12:20 pm
Posts: 4
Hy Hardy,

thanks for your reply.

I've found my mistake. In the Jboss /lib-folder were some older HS-Jars, so DynmicBoost was not invoked at indexing time. Replacing the old jars with the new ones solved that problem.

Best,
Jens


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.