-->
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.  [ 2 posts ] 
Author Message
 Post subject: Override DefaultSimilarity with Hibernate Search 3.0.0.GA?
PostPosted: Mon Jul 21, 2008 7:47 am 
Newbie

Joined: Thu Sep 13, 2007 7:01 am
Posts: 11
Hi,

we are using Seam together with Hibernate Search 3.0.0 GA and need to override Lucenes DefaultSimilarity class with our custom one.

How can I do this? I implemented our custom Similarity, overriding

Code:
public float lengthNorm(String fieldName, int numTerms)
public float tf(float freq)


methods.

Now the Lucene documentation says:
"To make this change, implement your own Similarity (likely you'll want to simply subclass DefaultSimilarity) and then use the new class by calling IndexWriter.setSimilarity before indexing and Searcher.setSimilarity before searching."

How can I pass the new Similarity Implementation to the IndexWriter and the Searcher when using Hibernate Search?

I know, that the latest Beta of HS supports this, but we are using 3.0.0.GA.

Any (fast) help would greatly be appreciated.

Thanks!

Alexander


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2008 4:22 am 
Hibernate Team
Hibernate Team

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

The 3.0.0.GA does not support it and there is not easy extension point in this version for adding your custom Similarity. Could you update to the latest version of Hibernate Search?

--Hardy


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