@@ -167,7 +167,7 @@ public function runQuery($query, array $options = array())
167
167
array (
168
168
'id ' => array_get ($ response , '_id ' ),
169
169
),
170
- json_decode (base64_decode (array_get ($ response , '_source._parameters ' , array () )), true )
170
+ json_decode (base64_decode (array_get ($ response , '_source._parameters ' , '' )), true )
171
171
));
172
172
}
173
173
@@ -187,7 +187,7 @@ public function runQuery($query, array $options = array())
187
187
'id ' => array_get ($ hit , '_id ' ),
188
188
'_score ' => array_get ($ hit , '_score ' ),
189
189
),
190
- json_decode (base64_decode (array_get ($ hit , '_source._parameters ' , array () )), true )
190
+ json_decode (base64_decode (array_get ($ hit , '_source._parameters ' , '' )), true )
191
191
);
192
192
}
193
193
}
@@ -233,7 +233,9 @@ public function insert($id, array $fields, array $parameters = array())
233
233
$ this ->delete ($ id );
234
234
} catch (\Elasticsearch \Common \Exceptions \Missing404Exception $ e ) {}
235
235
236
- $ fields ['_parameters ' ] = base64_encode (json_encode ($ parameters ));
236
+ if (!empty ($ parameters )) {
237
+ $ fields ['_parameters ' ] = base64_encode (json_encode ($ parameters ));
238
+ }
237
239
238
240
$ this ->getClient ()->index (array (
239
241
'index ' => $ this ->name ,
0 commit comments