@@ -301,7 +301,8 @@ public function processDeleteAll($wheres, $options = []): Results
301301 'id ' => $ wheres ['_id ' ],
302302 ];
303303 try {
304- $ response = $ this ->client ->delete ($ params );
304+ $ responseObject = $ this ->client ->delete ($ params );
305+ $ response = $ responseObject ->asArray ();
305306 $ response ['deleteCount ' ] = $ response ['result ' ] === 'deleted ' ? 1 : 0 ;
306307
307308 return $ this ->_return ($ response ['deleteCount ' ], $ response , $ params , $ this ->_queryTag (__FUNCTION__ ));
@@ -311,13 +312,14 @@ public function processDeleteAll($wheres, $options = []): Results
311312 }
312313 try {
313314 $ params = $ this ->buildParams ($ this ->index , $ wheres , $ options );
314- $ response = $ this ->client ->deleteByQuery ($ params );
315+ $ responseObject = $ this ->client ->deleteByQuery ($ params );
316+ $ response = $ responseObject ->asArray ();
315317 $ response ['deleteCount ' ] = $ response ['deleted ' ] ?? 0 ;
316318
317319 return $ this ->_return ($ response ['deleteCount ' ], $ response , $ params , $ this ->_queryTag (__FUNCTION__ ));
318320 } catch (Exception $ e ) {
319- $ result = $ this ->_returnError ($ e ->getMessage (), $ e ->getCode (), [], $ this ->_queryTag (__FUNCTION__ ));
320- throw new Exception ($ result ->errorMessage );
321+ $ error = $ this ->_returnError ($ e ->getMessage (), $ e ->getCode (), [], $ this ->_queryTag (__FUNCTION__ ));
322+ throw new Exception ($ error ->errorMessage );
321323 }
322324
323325 }
@@ -366,11 +368,11 @@ public function processIndexMappings($index): mixed
366368 {
367369 $ params = ['index ' => $ index ];
368370 try {
369- $ response = $ this ->client ->indices ()->getMapping ($ params );
371+ $ responseObject = $ this ->client ->indices ()->getMapping ($ params );
372+ $ response = $ responseObject ->asArray ();
370373 $ result = $ this ->_return ($ response , $ response , $ params , $ this ->_queryTag (__FUNCTION__ ));
371374
372-
373- return $ result ->data ->asArray ();
375+ return $ result ->data ;
374376 } catch (Exception $ e ) {
375377 $ result = $ this ->_returnError ($ e ->getMessage (), $ e ->getCode (), $ params , $ this ->_queryTag (__FUNCTION__ ));
376378 throw new Exception ($ result ->errorMessage );
0 commit comments