Skip to content

Commit 6f9ba45

Browse files
author
Simonas Šerlinskas
committed
Merge branch '5.x' into 6.x
# Conflicts: # composer.json
2 parents 82a1b91 + 83c4732 commit 6f9ba45

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Diff for: src/Query/Compound/FunctionScoreQuery.php

+12-7
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ private function applyFilter(array &$function, BuilderInterface $query = null)
9191
* @param array $function
9292
* @param array $options
9393
* @param BuilderInterface $query
94+
* @param int $weight
9495
*
9596
* @return $this
9697
*/
@@ -99,14 +100,18 @@ public function addDecayFunction(
99100
$field,
100101
array $function,
101102
array $options = [],
102-
BuilderInterface $query = null
103+
BuilderInterface $query = null,
104+
$weight = null
103105
) {
104-
$function = [
105-
$type => array_merge(
106-
[$field => $function],
107-
$options
108-
),
109-
];
106+
$function = array_filter(
107+
[
108+
$type => array_merge(
109+
[$field => $function],
110+
$options
111+
),
112+
'weight' => $weight,
113+
]
114+
);
110115

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

0 commit comments

Comments
 (0)