src/Query/Compound/FunctionScoreQuery.php
public function addScriptScoreFunction(
        $inline,
        array $params = [],
        array $options = [],
        BuilderInterface $query = null
    ) {
        $function = [
            'script_score' => [
                'script' =>
                    array_filter(
                        array_merge(
                            [
                                'lang' => 'painless',
                                'inline' => $inline,
                                'params' => $params
                            ],
                            $options
                        )
                    )
            ],
        ];

        $this->applyFilter($function, $query);
        $this->functions[] = $function;

        return $this;
    }
public function addScriptScoreFunction(
        $inline,
        array $params = [],
        array $options = [],
        BuilderInterface $query = null
    ) {
        $function = [
            'script_score' => [
                'script' =>
                    array_filter(
                        array_merge(
                            [
                                'lang' => 'painless',
                                'inline' => $inline,
                                'params' => $params
                            ],
                            $options
                        )
                    )
            ],
        ];

        $this->applyFilter($function, $query);
        $this->functions[] = $function;

        return $this;
    }
public function addScriptScoreFunction ( $ inline , array $ params = [ ] , array $ options = [ ] , BuilderInterface $ query = null ) { $ function = [ 'script_score' => [ 'script' => array_filter ( array_merge ( [ 'lang' => 'painless' , 'inline' => $ inline , 'params' => $ params ] , $ options ) ) ] , ] ; $ this -> applyFilter ( $ function , $ query ) ; $ this -> functions [ ] = $ function ; return $ this ; }
Adds script score function.

@param string           $inline
@param array            $params
@param array            $options
@param BuilderInterface $query

@return $this
Adds script score function .