public function getBlocksMetadata()
{
// TODO will have to be replace by block.metadata.write once https://github.com/elasticsearch/elasticsearch/pull/9203 has been fixed
// the try/catch will have to be remove too
try {
return (bool) $this->get('blocks.write');
} catch (ResponseException $e) {
if (strpos($e->getMessage(), 'ClusterBlockException') !== false) {
// hacky way to test if the metadata is blocked since bug 9203 is not fixed
return true;
}
throw $e;
}
}