mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 08:06:59 +02:00
Elasticsearch: fix select when fields are explicit
If fields are explicitly said, ES returns each row as an array.
This commit is contained in:
@@ -158,6 +158,9 @@ if (isset($_GET["elastic"])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($fields as $key => $val) {
|
foreach ($fields as $key => $val) {
|
||||||
|
if ($data["fields"]) {
|
||||||
|
$val = $val[0];
|
||||||
|
}
|
||||||
$row[$key] = (is_array($val) ? json_encode($val) : $val); //! display JSON and others differently
|
$row[$key] = (is_array($val) ? json_encode($val) : $val); //! display JSON and others differently
|
||||||
}
|
}
|
||||||
$return[] = $row;
|
$return[] = $row;
|
||||||
|
Reference in New Issue
Block a user