org.apache.lucene.search.payloads

## Class PayloadFunction

- java.lang.Object
- - org.apache.lucene.search.payloads.PayloadFunction

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AveragePayloadFunction, MaxPayloadFunction, MinPayloadFunction

      public abstract class PayloadFunction
      extends java.lang.Object
      implements java.io.Serializable

  An abstract class that defines a way for Payload*Query instances to transform the cumulative effects of payload scores for a document.
  See Also:
    `for more information

    This class and its derivations are experimental and subject to change`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PayloadFunction()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract float` | `currentScore(int docId, java.lang.String field, int start, int end, int numPayloadsSeen, float currentScore, float currentPayloadScore)` Calculate the score up to this point for this doc and field
    `abstract float` | `docScore(int docId, java.lang.String field, int numPayloadsSeen, float payloadScore)` Calculate the final score for all the payloads seen so far for this doc/field
    `abstract boolean` | `equals(java.lang.Object o)`
    `abstract int` | `hashCode()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PayloadFunction

          public PayloadFunction()

  - ### Method Detail

    - #### currentScore

          public abstract float currentScore(int docId,
                                             java.lang.String field,
                                             int start,
                                             int end,
                                             int numPayloadsSeen,
                                             float currentScore,
                                             float currentPayloadScore)

      Calculate the score up to this point for this doc and field
      Parameters:
        `docId` - The current doc
        `field` - The field
        `start` - The start position of the matching Span
        `end` - The end position of the matching Span
        `numPayloadsSeen` - The number of payloads seen so far
        `currentScore` - The current score so far
        `currentPayloadScore` - The score for the current payload
      Returns:
        The new current Score
      See Also:
        `Spans`

    - #### docScore

          public abstract float docScore(int docId,
                                         java.lang.String field,
                                         int numPayloadsSeen,
                                         float payloadScore)

      Calculate the final score for all the payloads seen so far for this doc/field
      Parameters:
        `docId` - The current doc
        `field` - The current field
        `numPayloadsSeen` - The total number of payloads seen on this document
        `payloadScore` - The raw score for those payloads
      Returns:
        The final score for the payloads

    - #### hashCode

          public abstract int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public abstract boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.