$params variable is not declared;
```php
$params = [
    'index' => 'phraseanet',
    'type' => 'record',
    'body' => [
         'fields' => ['databox_id', 'record_id'],
         'sort'   => $this->createSortQueryParams($options),
    ]
]
``