src/Query/Compound/FunctionScoreQuery.php
public function addDecayFunction(
        $type,
        $field,
        array $function,
        array $options = [],
        BuilderInterface $query = null,
        $weight = null
    ) {
        $function = array_filter(
            [
                $type => array_merge(
                    [$field => $function],
                    $options
                ),
                'weight' => $weight,
            ]
        );

        $this->applyFilter($function, $query);

        $this->functions[] = $function;

        return $this;
    }
public function addDecayFunction(
        $type,
        $field,
        array $function,
        array $options = [],
        BuilderInterface $query = null,
        $weight = null
    ) {
        $function = array_filter(
            [
                $type => array_merge(
                    [$field => $function],
                    $options
                ),
                'weight' => $weight,
            ]
        );

        $this->applyFilter($function, $query);

        $this->functions[] = $function;

        return $this;
    }
public function addDecayFunction ( $ type , $ field , array $ function , array $ options = [ ] , BuilderInterface $ query = null , $ weight = null ) { $ function = array_filter ( [ $ type => array_merge ( [ $ field => $ function ] , $ options ) , 'weight' => $ weight , ] ) ; $ this -> applyFilter ( $ function , $ query ) ; $ this -> functions [ ] = $ function ; return $ this ; }
Add decay function to function score. Weight and query are optional.

@param string           $type
@param string           $field
@param array            $function
@param array            $options
@param BuilderInterface $query
@param int              $weight

@return $this
Add decay function to function score . Weight and query are optional .