Skip to content

Commit e91ad35

Browse files
authored
Merge pull request #160 from ElementareTeilchen/patch-1
BUGFIX: Bulk request needs to end with \n
2 parents 910cf0c + 342dce3 commit e91ad35

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Classes/Indexer/NodeIndexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ protected function removeDuplicateDocuments($contextPath, $contextPathHash, Node
329329

330330

331331
$mapHitToDeleteRequest = function ($hit) {
332-
$bulkRequest[] = json_encode([
332+
return json_encode([
333333
'delete' => [
334334
'_type' => $hit['_type'],
335335
'_id' => $hit['_id']
@@ -347,7 +347,7 @@ protected function removeDuplicateDocuments($contextPath, $contextPathHash, Node
347347

348348
$this->logger->log(sprintf('NodeIndexer: Check duplicate nodes for %s (%s), found %d document(s). ContentContextHash: %s', $contextPath, $type, count($bulkRequest), $contextPathHash), LOG_DEBUG, null, 'ElasticSearch (CR)');
349349
if ($bulkRequest !== []) {
350-
$this->getIndex()->request('POST', '/_bulk', [], implode("\n", $bulkRequest));
350+
$this->getIndex()->request('POST', '/_bulk', [], implode("\n", $bulkRequest) . "\n");
351351
}
352352
$this->searchClient->request('DELETE', '/_search/scroll', [], json_encode([
353353
'scroll_id' => [

0 commit comments

Comments
 (0)