1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 17:19:52 +02:00

Fix version condition for deprecated mapping types

Mapping types are still supported in version 6, but only one mapping type can be created.
In version 7, mapping types are deprecated and there is only one system '_doc' mapping type.
See: https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html
This commit is contained in:
Peter Knut
2021-04-03 15:19:53 +02:00
parent e8c9164a77
commit 857cbf03f2

View File

@@ -122,7 +122,7 @@ if (isset($_GET["elastic"])) {
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
global $adminer;
$data = array();
$query = (min_version(6) ? "" : "$table/") . "_search";
$query = (min_version(7) ? "" : "$table/") . "_search";
if ($select != array("*")) {
$data["fields"] = $select;
}
@@ -307,7 +307,7 @@ if (isset($_GET["elastic"])) {
function tables_list() {
global $connection;
if (min_version(6)) {
if (min_version(7)) {
return array('_doc' => 'table');
}
@@ -368,7 +368,7 @@ if (isset($_GET["elastic"])) {
global $connection;
$mappings = array();
if (min_version(6)) {
if (min_version(7)) {
$result = $connection->query("_mapping");
if ($result) {
$mappings = $result[$connection->_db]['mappings']['properties'];