lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: Using alternative scoring mechanism.
Date Sun, 02 Dec 2012 16:36:11 GMT
I thought it was that simple too, but I couldn't find the 
"get/setSimilarityProvider" methods listed in that patch, and no mention in 
the Similarity class. Obviously this feature has morphed a bit since then. 
To cut to the chase, you still use the old methods for setting the 
similarity class (IndexSearcher#setSimilarity), but now you need to 
instantiate a PerFieldSimilarityWrapper that provides a "get" method for 
each field. It is mentioned in the Similarity javadoc, if you read it 
carefully enough.


This appear to be the change from that original design:

-- Jack Krupansky

-----Original Message----- 
From: Erick Erickson
Sent: Sunday, December 02, 2012 9:54 AM
To: java-user
Subject: Re: Using alternative scoring mechanism.

I think you're looking for per-field similiarity, does this help?

Note, in 4.0 only


On Sat, Dec 1, 2012 at 1:43 PM, Eyal Ben Meir <> wrote:

> Can one replace the basic scoring algorithm (TF/IDF) for a specific field,
> to use a different one?
> I need to compute similarity for NAME field.  The regular TF/IDF is not
> good
> enough, and I want to use a Name Recognition Engine as a scorer.
> How can it be done?
> Thanks,  Eyal.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message