Class AveragePayloadFunction
java.lang.Object
org.apache.lucene.queries.payloads.PayloadFunction
org.apache.lucene.queries.payloads.AveragePayloadFunction
Calculate the final score as the average score of all payloads seen.
Is thread safe and completely reusable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatcurrentScore(int docId, String field, int start, int end, int numPayloadsSeen, float currentScore, float currentPayloadScore) Calculate the score up to this point for this doc and fieldfloatCalculate the final score for all the payloads seen so far for this doc/fieldbooleaninthashCode()Methods inherited from class org.apache.lucene.queries.payloads.PayloadFunction
explain
-
Constructor Details
-
AveragePayloadFunction
public AveragePayloadFunction()
-
-
Method Details
-
currentScore
public float currentScore(int docId, String field, int start, int end, int numPayloadsSeen, float currentScore, float currentPayloadScore) Description copied from class:PayloadFunctionCalculate the score up to this point for this doc and field- Specified by:
currentScorein classPayloadFunction- Parameters:
docId- The current docfield- The fieldstart- The start position of the matching Spanend- The end position of the matching SpannumPayloadsSeen- The number of payloads seen so farcurrentScore- The current score so farcurrentPayloadScore- The score for the current payload- Returns:
- The new current Score
- See Also:
-
docScore
Description copied from class:PayloadFunctionCalculate the final score for all the payloads seen so far for this doc/field- Specified by:
docScorein classPayloadFunction- Parameters:
docId- The current docfield- The current fieldnumPayloadsSeen- The total number of payloads seen on this documentpayloadScore- The raw score for those payloads- Returns:
- The final score for the payloads
-
hashCode
public int hashCode()- Specified by:
hashCodein classPayloadFunction
-
equals
- Specified by:
equalsin classPayloadFunction
-