From f5ba75c4fbdd8248026d4450913e495f75aa28c0 Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io> Date: Wed, 1 Jul 2015 15:34:21 +0300 Subject: [PATCH] Use empty stdClass instead of empty array. In method addRandomFunction. Elasticsearch expects object not array and empty array will not be made into object. --- src/Query/FunctionScoreQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Query/FunctionScoreQuery.php b/src/Query/FunctionScoreQuery.php index 9e09a52..d7d6c6e 100644 --- a/src/Query/FunctionScoreQuery.php +++ b/src/Query/FunctionScoreQuery.php @@ -162,7 +162,7 @@ class FunctionScoreQuery implements BuilderInterface public function addRandomFunction($seed = null, BuilderInterface $filter = null) { $function = [ - 'random_score' => $seed ? [ 'seed' => $seed ] : [], + 'random_score' => $seed ? [ 'seed' => $seed ] : new \stdClass(), ]; $this->applyFilter($function, $filter); -- GitLab