Skip to content

Commit

Permalink
add small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Oct 22, 2024
1 parent 82504e1 commit 1ae4909
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/IndexService/Worker/OpenSearch/AbstractOpenSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ abstract class AbstractOpenSearch extends ProductCentricBatchProcessingWorker

protected LoggerInterface $logger;

public function __construct(SearchConfigInterface $tenantConfig, Connection $db, EventDispatcherInterface $eventDispatcher, LoggerInterface $pimcoreEcommerceEsLogger)
public function __construct(SearchConfigInterface $tenantConfig, Connection $db, EventDispatcherInterface $eventDispatcher, LoggerInterface $pimcoreEcommerceOsLogger)
{
parent::__construct($tenantConfig, $db, $eventDispatcher);
$this->logger = $pimcoreEcommerceEsLogger;
$this->indexName = ($tenantConfig->getClientConfig('indexName')) ? strtolower($tenantConfig->getClientConfig('indexName')) : strtolower($this->name);
$this->logger = $pimcoreEcommerceOsLogger;
$this->indexName = strtolower(($tenantConfig->getClientConfig('indexName')) ?: $this->name);
}

/**
Expand Down Expand Up @@ -231,15 +231,16 @@ protected function createMappingAttributes(): array
}
}

if ($type == ProductListInterface::PRODUCT_TYPE_OBJECT) { //object doesn't support index or store
//object doesn't support index or store
if ($type === ProductListInterface::PRODUCT_TYPE_OBJECT) {
$mapping = ['type' => $type];
}

if (!$attribute->getOption('store')) {
$mapping['store'] = false;
}

if ($type == ProductListInterface::PRODUCT_TYPE_OBJECT || $type == 'nested') {
if ($type === ProductListInterface::PRODUCT_TYPE_OBJECT || $type === 'nested') {
unset($mapping['store']);
}

Expand Down

0 comments on commit 1ae4909

Please sign in to comment.