Skip to content

Commit 1fbbd45

Browse files
committed
AC-7116: Fixed MHI test failures
1 parent e2443d9 commit 1fbbd45

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/code/Magento/Elasticsearch8/Block/Adminhtml/System/Config/TestConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Conf
1515
/**
1616
* @inheritdoc
1717
*/
18-
protected function _getFieldMapping(): array
18+
public function _getFieldMapping(): array
1919
{
2020
$fields = [
2121
'engine' => 'catalog_search_engine',

app/code/Magento/Elasticsearch8/Model/Adapter/Elasticsearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Elasticsearch extends \Magento\Elasticsearch\Model\Adapter\Elasticsearch
2020
* @param string $action
2121
* @return array
2222
*/
23-
protected function getDocsArrayInBulkIndexFormat(
23+
public function getDocsArrayInBulkIndexFormat(
2424
$documents,
2525
$indexName,
2626
$action = self::BULK_ACTION_INDEX

app/code/Magento/Elasticsearch8/Model/Client/Elasticsearch.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Elasticsearch implements ClientInterface
3232
*/
3333
private array $client;
3434

35-
3635
/**
3736
* @var bool|null
3837
*/
@@ -91,7 +90,9 @@ private function getElasticsearchClient(): Client /** @phpstan-ignore-line */
9190
$pid = getmypid();
9291
if (!isset($this->client[$pid])) {
9392
$config = $this->buildESConfig($this->clientOptions);
94-
$this->client[$pid] = ClientBuilder::fromConfig($config, true); /** @phpstan-ignore-line */
93+
if (class_exists(\Elastic\Elasticsearch\ClientBuilder::class)) {
94+
$this->client[$pid] = ClientBuilder::fromConfig($config, true); /** @phpstan-ignore-line */
95+
}
9596
}
9697
return $this->client[$pid];
9798
}

0 commit comments

Comments
 (0)