Skip to content

Commit

Permalink
ES8: Do not use _type when proceeding bulk errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Feb 22, 2023
1 parent c78aaa7 commit b2d2720
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/module-elasticsuite-core/Index/Bulk/BulkResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ public function aggregateErrorsByReason()
$operationType = current(array_keys($item));
$itemData = $item[$operationType];
$index = $itemData['_index'];
$documentType = $itemData['_type'];
$errorData = $itemData['error'];
$errorKey = $operationType . $errorData['type'] . $errorData['reason'] . $index . $documentType;
$errorKey = $operationType . $errorData['type'] . $errorData['reason'] . $index;

if (!isset($errorByReason[$errorKey])) {
$errorByReason[$errorKey] = [
'index' => $itemData['_index'],
'document_type' => $itemData['_type'],
'operation' => $operationType,
'error' => ['type' => $errorData['type'], 'reason' => $errorData['reason']],
'count' => 0,
Expand Down
5 changes: 2 additions & 3 deletions src/module-elasticsuite-core/Index/IndexOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,10 @@ protected function parseBulkResponse(array $rawBulkResponse)
$sampleDocumentIds = implode(', ', array_slice($error['document_ids'], 0, 10));
$errorMessages = [
sprintf(
"Bulk %s operation failed %d times in index %s for type %s.",
"Bulk %s operation failed %d times in index %s.",
$error['operation'],
$error['count'],
$error['index'],
$error['document_type']
$error['index']
),
sprintf(
"Error (%s) : %s.",
Expand Down

0 comments on commit b2d2720

Please sign in to comment.