TestConnection.php 1.03 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Elasticsearch6\Block\Adminhtml\System\Config;

/**
 * Elasticsearch 6.x test connection block
 */
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
{
    /**
     * @inheritdoc
     */
    protected function _getFieldMapping()
    {
        $fields = [
            'engine' => 'catalog_search_engine',
            'hostname' => 'catalog_search_elasticsearch6_server_hostname',
            'port' => 'catalog_search_elasticsearch6_server_port',
            'index' => 'catalog_search_elasticsearch6_index_prefix',
            'enableAuth' => 'catalog_search_elasticsearch6_enable_auth',
            'username' => 'catalog_search_elasticsearch6_username',
            'password' => 'catalog_search_elasticsearch6_password',
            'timeout' => 'catalog_search_elasticsearch6_server_timeout',
        ];

        return array_merge(parent::_getFieldMapping(), $fields);
    }
}