Skip to content

Commit 006407c

Browse files
remuslazardaniellienert
authored andcommitted
Streamline the document identifier logic in IndexerDriver
Instead of doing the sha1 dance manually, use static method for that so we can stay DRY
1 parent 081d15b commit 006407c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Classes/Driver/Version6/IndexerDriver.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* source code.
1414
*/
1515

16-
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Domain\Model\TargetContextPath;
16+
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer;
1717
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Driver\AbstractIndexerDriver;
1818
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Driver\IndexerDriverInterface;
1919
use Flowpack\ElasticSearch\Domain\Model\Document as ElasticSearchDocument;
@@ -90,11 +90,7 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, string
9090
return [];
9191
}
9292

93-
$closestFulltextNodeContextPath = $closestFulltextNode->getContextPath();
94-
if ($targetWorkspaceName !== null) {
95-
$closestFulltextNodeContextPath = (string)(new TargetContextPath($node, $targetWorkspaceName, $closestFulltextNodeContextPath));
96-
}
97-
$closestFulltextNodeDocumentIdentifier = sha1($closestFulltextNodeContextPath);
93+
$closestFulltextNodeDocumentIdentifier = NodeIndexer::calculateDocumentIdentifier($closestFulltextNode);
9894

9995
if ($closestFulltextNode->isRemoved()) {
10096
// fulltext root is removed, abort silently...

0 commit comments

Comments
 (0)