]> git.joonet.de Git - adminer.git/commitdiff
Fix version condition for deprecated mapping types
authorPeter Knut <peter@pematon.com>
Sat, 3 Apr 2021 13:19:53 +0000 (15:19 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:35 +0000 (11:16 +0100)
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

adminer/drivers/elastic.inc.php

index 4f9ce28d7f8b29f4d71705498442339c13abb92f..b824a3d7baea48dbc1753a9bb0e68791ca9f1fdc 100644 (file)
@@ -111,7 +111,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;
                        }
@@ -296,7 +296,7 @@ if (isset($_GET["elastic"])) {
        function tables_list() {
                global $connection;
 
-               if (min_version(6)) {
+               if (min_version(7)) {
                        return array('_doc' => 'table');
                }
 
@@ -357,7 +357,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'];