private function getIndexStatus()
    {
        if (version_compare($this->version, '2.2', '>')) {
            return $this->client->indices()->stats(['index' => '_all']);
        }

        return $this->client->indices()->status(['index' => '_all']);
    }