Class RecencyBoost

  • All Implemented Interfaces:
    Boost

    public class RecencyBoost
    extends Object
    implements Boost
    Represents a boost based on the recency of a date
    • Constructor Detail

      • RecencyBoost

        public RecencyBoost()
    • Method Detail

      • getType

        public Boost.BoostType getType()
        Description copied from interface: Boost
        Type of boost
        Specified by:
        getType in interface Boost
        Returns:
        The boost type
      • getCenter

        public String getCenter()
        The center for this boost
        Returns:
        The string representation of the center point
      • getName

        public String getName()
        Description copied from interface: Boost
        The name of the boost
        Specified by:
        getName in interface Boost
        Returns:
        the name
      • getFunction

        public Boost.Function getFunction()
        Type of function to calculate the boost value. Can be linear, exponential, or gaussian.
        Returns:
        The function
      • isUseNow

        public boolean isUseNow()
        Whether anchoring is based on special value "now"
        Returns:
        true if using special value "now", otherwise false
      • getFactor

        public BigDecimal getFactor()
        Description copied from interface: Boost
        Alter the impact of a boost on the score of a document. Must be between 0 and 10. Defaults to 1.0. A negative factor or fractional factor will not deboost a result. The factor parameter multiplies the value of the boost but does not significantly affect the decay function scale.
        Specified by:
        getFactor in interface Boost
        Returns:
        The factor
      • setName

        public RecencyBoost setName​(String name)
        Description copied from interface: Boost
        Set the name of the boost
        Specified by:
        setName in interface Boost
        Parameters:
        name - The boost name
        Returns:
        this.
      • setFunction

        public RecencyBoost setFunction​(Boost.Function function)
        Type of function to calculate the boost value. Can be linear, exponential, or gaussian.
        Parameters:
        function - The function to calculate the boost
        Returns:
        this.
      • setCenter

        public RecencyBoost setCenter​(OffsetDateTime center)
        The mode of the distribution, specified as a RFC3339 DateTime
        Parameters:
        center - The anchor point for the boost
        Returns:
        this.
      • setUseNow

        public RecencyBoost setUseNow​(boolean useNow)
        Whether anchoring is based on special value "now"
        Parameters:
        useNow - true to anchor on "now"
        Returns:
        this.
      • setFactor

        public RecencyBoost setFactor​(BigDecimal factor)
        Description copied from interface: Boost
        Alter the impact of a boost on the score of a document. Must be between 0 and 10. Defaults to 1.0. A negative factor or fractional factor will not deboost a result. The factor parameter multiplies the value of the boost but does not significantly affect the decay function scale.
        Specified by:
        setFactor in interface Boost
        Parameters:
        factor - A value between (inclusive) 0.0 and 10.0
        Returns:
        this.