mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 08:06:59 +02:00
ElasticSearch: table_statuses() also return count of rows
This commit is contained in:
@@ -224,10 +224,24 @@ if (isset($_GET["elastic"])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function table_status($name = "", $fast = false) {
|
function table_status($name = "", $fast = false) {
|
||||||
$return = tables_list();
|
global $connection;
|
||||||
if ($return) {
|
$search = $connection->query("_search?search_type=count", array(
|
||||||
foreach ($return as $key => $type) { // _stats have just info about database
|
"facets" => array(
|
||||||
$return[$key] = array("Name" => $key, "Engine" => $type);
|
"count_by_type" => array(
|
||||||
|
"terms" => array(
|
||||||
|
"field" => "_type"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
), "POST");
|
||||||
|
$return = array();
|
||||||
|
if ($search) {
|
||||||
|
foreach ($search["facets"]["count_by_type"]["terms"] as $table) {
|
||||||
|
$return[$table["term"]] = array(
|
||||||
|
"Name" => $table["term"],
|
||||||
|
"Engine" => "table",
|
||||||
|
"Rows" => $table["count"]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if ($name != "") {
|
if ($name != "") {
|
||||||
return $return[$name];
|
return $return[$name];
|
||||||
|
Reference in New Issue
Block a user