Skip to content
Snippets Groups Projects
Commit 245ec169 authored by Patryk Knysak's avatar Patryk Knysak Committed by Simonas Šerlinskas
Browse files

ES 5 support: Changed syntax of script_score (fix for #175) (#186)

parent 2259f649
No related branches found
No related tags found
No related merge requests found
......@@ -181,14 +181,23 @@ class FunctionScoreQuery implements BuilderInterface
array $options = [],
BuilderInterface $query = null
) {
$function = [
'script_score' => array_merge(
[
'script' => $script,
'params' => $params,
],
if (count($params) > 0) {
$options = array_merge(
['params' => $params],
$options
),
);
}
$function = [
'script_score' => [
'script' => array_merge(
[
'lang' => 'painless',
'inline' => $script
],
$options
)
]
];
$this->applyFilter($function, $query);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment