Skip to content

Commit 764de93

Browse files
BUGFIX: Retry on conflict also in fulltext method
1 parent b649dab commit 764de93

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Classes/Driver/Version6/IndexerDriver.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
class IndexerDriver extends AbstractIndexerDriver implements IndexerDriverInterface
3030
{
31+
/**
32+
* @Flow\InjectConfiguration(path="indexing.retryOnConflict")
33+
* @var int
34+
*/
35+
protected $retryOnConflict = 3;
3136

3237
/**
3338
* {@inheritdoc}
@@ -43,7 +48,7 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo
4348
'update' => [
4449
'_id' => $document->getId(),
4550
'_index' => $indexName,
46-
'retry_on_conflict' => 3
51+
'retry_on_conflict' => $this->retryOnConflict ?: 3
4752
]
4853
],
4954
// https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html
@@ -71,6 +76,7 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo
7176
'index' => [
7277
'_id' => $document->getId(),
7378
'_index' => $indexName,
79+
'retry_on_conflict' => $this->retryOnConflict ?: 3
7480
]
7581
],
7682
$documentData
@@ -108,7 +114,8 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, ?strin
108114
return [
109115
[
110116
'update' => [
111-
'_id' => $closestFulltextNodeDocumentIdentifier
117+
'_id' => $closestFulltextNodeDocumentIdentifier,
118+
'retry_on_conflict' => $this->retryOnConflict ?: 3
112119
]
113120
],
114121
// https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html

Configuration/Settings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Flowpack:
44
command:
55
useSubProcesses: true
66
indexing:
7+
retryOnConflict: 3
78
batchSize:
89
elements: 500
910
octets: 40000000

0 commit comments

Comments
 (0)