// query-dsl/function-score-query.asciidoc:137

[source, php]
----
$params = [
    'body' => [
        'query' => [
            'function_score' => [
                'query' => [
                    'match' => [
                        'message' => 'elasticsearch',
                    ],
                ],
                'script_score' => [
                    'script' => [
                        'source' => 'Math.log(2 + doc[\'likes\'].value)',
                    ],
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
