> For the complete documentation index, see [llms.txt](https://learnsql.gitbook.io/lernmysql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnsql.gitbook.io/lernmysql/get-all-indices-ok.md).

# Get all indices (ok)

![](/files/-MPyu3g2rN7KNrXK8VHf)

C:\Users\Administrator\Documents\windows\manageindex.php

```
<?php
use Elasticsearch\ClientBuilder;
require 'vendor/autoload.php';
$hosts = [
  [
    'host'   => 'localhost',
    'port'   => '9200',
    'scheme' => 'http'
  ],
];
$client = ClientBuilder::create()->setHosts($hosts)->build();
$response = $client->cat()->indices();
echo '<pre>';
  var_export($response);
echo '</pre>';
?>
```
