Class Score
java.lang.Object
org.springframework.data.domain.Score
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Similarity
Value object representing a search result score computed via a
ScoringFunction.
Encapsulates the numeric score and the scoring function used to derive it. Scores are primarily used to rank search
results. Depending on the used ScoringFunction higher scores can indicate either a higher distance or a
higher similarity. Use the Similarity class to indicate usage of a normalized score across representing
effectively the similarity.
Instances of this class are immutable and suitable for use in comparison, sorting, and range operations.
- Since:
- 4.0
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates aRangefrom the given minimum and maximumScorevalues.booleanReturns theScoringFunctionthat was used to compute this score.doublegetValue()Returns the raw numeric value of the score.inthashCode()static Scoreof(double score) static Scoreof(double score, ScoringFunction function) toString()
-
Method Details
-
of
- Parameters:
score- the score value without a specificScoringFunction.- Returns:
- the new
Score.
-
of
- Parameters:
score- the score value.function- the scoring function that has computed thescore.- Returns:
- the new
Score.
-
between
-
getValue
public double getValue()Returns the raw numeric value of the score.- Returns:
- the score value.
-
getFunction
Returns theScoringFunctionthat was used to compute this score.- Returns:
- the associated scoring function.
-
equals
-
hashCode
-
toString
-