Class MaxPayloadFunction
- java.lang.Object
-
- org.apache.lucene.search.payloads.PayloadFunction
-
- org.apache.lucene.search.payloads.MaxPayloadFunction
-
public class MaxPayloadFunction extends PayloadFunction
Returns the maximum payload score seen, else 1 if there are no payloads on the doc. Is thread safe and completely reusable.
-
-
Constructor Summary
Constructors Constructor Description MaxPayloadFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
currentScore(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 fieldfloat
docScore(int docId, String field, int numPayloadsSeen, float payloadScore)
Calculate the final score for all the payloads seen so far for this doc/fieldboolean
equals(Object obj)
int
hashCode()
-
Methods inherited from class org.apache.lucene.search.payloads.PayloadFunction
explain
-
-
-
-
Method Detail
-
currentScore
public float currentScore(int docId, String field, int start, int end, int numPayloadsSeen, float currentScore, float currentPayloadScore)
Description copied from class:PayloadFunction
Calculate the score up to this point for this doc and field- Specified by:
currentScore
in 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:
Spans
-
docScore
public float docScore(int docId, String field, int numPayloadsSeen, float payloadScore)
Description copied from class:PayloadFunction
Calculate the final score for all the payloads seen so far for this doc/field- Specified by:
docScore
in 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:
hashCode
in classPayloadFunction
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in classPayloadFunction
-
-