How do I get Data in Array format from a 'find('all')' call.
$query->all ()->getResponse ()->getData ()['message']
gives me a json string '{\"_source[]....}'
Below is my code sample
use Cake\ElasticSearch\TypeRegistry;
class PagesController extends AppController {
public function index() {
$english_pages = TypeRegistry::get ( 'EnglishPages' );
$query = $english_pages->find ( 'all' );
// $query = $query->getData();
// $query->all () ;
// $query->all ()->getResponse () );
// json_decode ( stripslashes($query->all ()->getResponse ()->getData ()['message']) , true ) ;
// echo json_last_error_msg ();
// json_encode ( $query->all ()->getResponse ()->getData ()['message'] ) ;
}
}
The Cakephp docs are not inline with the current Cakephp3 Elastic search on Github.