Skip to content

Commit 6f35b71

Browse files
remuslazardaniellienert
authored andcommitted
Change the algorithm in calculateDocumentIdentifier
Use the node identifier instead of its path to generate the ES document identifier
1 parent c07916c commit 6f35b71

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Classes/Indexer/NodeIndexer.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,10 @@ protected function toBulkRequest(NodeInterface $node, array $requests = null): v
352352
*/
353353
protected function calculateDocumentIdentifier(NodeInterface $node, $targetWorkspaceName = null): string
354354
{
355-
$contextPath = $node->getContextPath();
355+
$workspaceName = $targetWorkspaceName ?: $node->getWorkspace()->getName();
356+
$nodeIdentifier = $node->getIdentifier();
356357

357-
if ($targetWorkspaceName !== null) {
358-
$contextPath = (string)(new TargetContextPath($node, $targetWorkspaceName, $contextPath));
359-
}
360-
361-
return sha1($contextPath);
358+
return sha1($nodeIdentifier . $workspaceName);
362359
}
363360

364361
/**

0 commit comments

Comments
 (0)