tags:

views:

32

answers:

1

http://lucene.apache.org/java/2_3_0/api/org/apache/lucene/misc/SweetSpotSimilarity.html

Implemented as: 1/sqrt( steepness * (abs(x-min) + abs(x-max) - (max-min)) + 1 ) .

This degrades to 1/sqrt(x) when min and max are both 1 and steepness is 0.5

Can anyone explain this formula for me? How steepness is decided and what is exactly referring to?

Any help is appreciated.

A: 

With the DefaultSimilarity, the shorter the field in terms of number of tokens, the higher the score.

e.g. if you have two docs, with indexed field values of "the quick brown fox" and "brown fox", respectively, the latter would score higher in a query for "fox".

SweetSpotSimilarity lets you define a "sweet spot" for the length of a field in terms of a range defined by min and max. Field lengths within the range will score equally, and field lengths outside the range will score lower, depending on the distance the length is form the range boundary. "steepness" determines how quickly the score degrades as a function of distance.

KenE