Skip to content

Commit fcc38ef

Browse files
committed
Fix code sniffer violations in elasticsearch adapter
1 parent 320aac0 commit fcc38ef

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function cleanIndex($storeId, $mappedIndexerId)
206206
// prepare new index name and increase version
207207
$indexPattern = $this->indexNameResolver->getIndexPattern($storeId, $mappedIndexerId);
208208
$version = (int)(str_replace($indexPattern, '', $indexName));
209-
$newIndexName = $indexPattern . ++$version;
209+
$newIndexName = $indexPattern . (++$version);
210210

211211
// remove index if already exists
212212
if ($this->client->indexExists($newIndexName)) {
@@ -357,12 +357,14 @@ protected function prepareIndex($storeId, $indexName, $mappedIndexerId)
357357
{
358358
$this->indexBuilder->setStoreId($storeId);
359359
$settings = $this->indexBuilder->build();
360-
$allAttributeTypes = $this->fieldMapper->getAllAttributesTypes([
361-
'entityType' => $mappedIndexerId,
362-
// Use store id instead of website id from context for save existing fields mapping.
363-
// In future websiteId will be eliminated due to index stored per store
364-
'websiteId' => $storeId
365-
]);
360+
$allAttributeTypes = $this->fieldMapper->getAllAttributesTypes(
361+
[
362+
'entityType' => $mappedIndexerId,
363+
// Use store id instead of website id from context for save existing fields mapping.
364+
// In future websiteId will be eliminated due to index stored per store
365+
'websiteId' => $storeId
366+
]
367+
);
366368
$settings['index']['mapping']['total_fields']['limit'] = $this->getMappingTotalFieldsLimit($allAttributeTypes);
367369
$this->client->createIndex($indexName, ['settings' => $settings]);
368370
$this->client->addFieldsMapping(

0 commit comments

Comments
 (0)