|
34 | 34 | use Neos\ContentRepository\Search\Indexer\AbstractNodeIndexer; |
35 | 35 | use Neos\ContentRepository\Search\Indexer\BulkNodeIndexerInterface; |
36 | 36 | use Neos\Flow\Annotations as Flow; |
| 37 | +use Neos\Flow\Log\Utility\LogEnvironment; |
37 | 38 | use Neos\Flow\Persistence\Exception\IllegalObjectTypeException; |
38 | 39 | use Psr\Log\LoggerInterface; |
39 | 40 |
|
@@ -163,6 +164,7 @@ public function setIndexNamePostfix(string $indexNamePostfix): void |
163 | 164 | * |
164 | 165 | * @return Index |
165 | 166 | * @throws Exception |
| 167 | + * @throws \Flowpack\ElasticSearch\Exception |
166 | 168 | */ |
167 | 169 | public function getIndex(): Index |
168 | 170 | { |
@@ -208,13 +210,13 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null) |
208 | 210 |
|
209 | 211 | if ($this->bulkProcessing === false) { |
210 | 212 | // Remove document with the same contextPathHash but different NodeType, required after NodeType change |
211 | | - $this->logger->debug(sprintf('NodeIndexer (%s): Search and remove duplicate document for node %s (%s) if needed.', $documentIdentifier, $contextPath, $node->getIdentifier())); |
| 213 | + $this->logger->debug(sprintf('NodeIndexer (%s): Search and remove duplicate document for node %s (%s) if needed.', $documentIdentifier, $contextPath, $node->getIdentifier()), LogEnvironment::fromMethodName(__METHOD__)); |
212 | 214 | $this->documentDriver->deleteDuplicateDocumentNotMatchingType($this->getIndex(), $documentIdentifier, $node->getNodeType()); |
213 | 215 | } |
214 | 216 |
|
215 | 217 | $fulltextIndexOfNode = []; |
216 | 218 | $nodePropertiesToBeStoredInIndex = $this->extractPropertiesAndFulltext($node, $fulltextIndexOfNode, function ($propertyName) use ($documentIdentifier, $node) { |
217 | | - $this->logger->debug(sprintf('NodeIndexer (%s) - Property "%s" not indexed because no configuration found, node type %s.', $documentIdentifier, $propertyName, $node->getNodeType()->getName())); |
| 219 | + $this->logger->debug(sprintf('NodeIndexer (%s) - Property "%s" not indexed because no configuration found, node type %s.', $documentIdentifier, $propertyName, $node->getNodeType()->getName()), LogEnvironment::fromMethodName(__METHOD__)); |
218 | 220 | }); |
219 | 221 |
|
220 | 222 | $document = new ElasticSearchDocument($mappingType, |
@@ -249,9 +251,9 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null) |
249 | 251 | $documentIdentifier = $this->calculateDocumentIdentifier($node, $targetWorkspaceName); |
250 | 252 | if ($node->isRemoved()) { |
251 | 253 | $this->removeNode($node, $context->getWorkspaceName()); |
252 | | - $this->logger->debug(sprintf('NodeIndexer (%s): Removed node with identifier %s, no longer in workspace %s', $documentIdentifier, $node->getIdentifier(), $context->getWorkspaceName())); |
| 254 | + $this->logger->debug(sprintf('NodeIndexer (%s): Removed node with identifier %s, no longer in workspace %s', $documentIdentifier, $node->getIdentifier(), $context->getWorkspaceName()), LogEnvironment::fromMethodName(__METHOD__)); |
253 | 255 | } else { |
254 | | - $this->logger->debug(sprintf('NodeIndexer (%s): Could not index node with identifier %s, not found in workspace %s with dimensions %s', $documentIdentifier, $node->getIdentifier(), $context->getWorkspaceName(), json_encode($context->getDimensions()))); |
| 256 | + $this->logger->debug(sprintf('NodeIndexer (%s): Could not index node with identifier %s, not found in workspace %s with dimensions %s', $documentIdentifier, $node->getIdentifier(), $context->getWorkspaceName(), json_encode($context->getDimensions())), LogEnvironment::fromMethodName(__METHOD__)); |
255 | 257 | } |
256 | 258 | } |
257 | 259 | }; |
@@ -316,14 +318,15 @@ public function removeNode(NodeInterface $node, string $targetWorkspaceName = nu |
316 | 318 | $this->currentBulkRequest[] = $this->documentDriver->delete($node, $documentIdentifier); |
317 | 319 | $this->currentBulkRequest[] = $this->indexerDriver->fulltext($node, [], $targetWorkspaceName); |
318 | 320 |
|
319 | | - $this->logger->debug(sprintf('NodeIndexer (%s): Removed node %s (%s) from index.', $documentIdentifier, $node->getContextPath(), $node->getIdentifier())); |
| 321 | + $this->logger->debug(sprintf('NodeIndexer (%s): Removed node %s (%s) from index.', $documentIdentifier, $node->getContextPath(), $node->getIdentifier()), LogEnvironment::fromMethodName(__METHOD__)); |
320 | 322 | } |
321 | 323 |
|
322 | 324 | /** |
323 | 325 | * Perform the current bulk request |
324 | 326 | * |
325 | 327 | * @return void |
326 | 328 | * @throws Exception |
| 329 | + * @throws \Flowpack\ElasticSearch\Exception |
327 | 330 | */ |
328 | 331 | public function flush() |
329 | 332 | { |
@@ -368,6 +371,7 @@ public function flush() |
368 | 371 | * @return void |
369 | 372 | * @throws Exception |
370 | 373 | * @throws ApiException |
| 374 | + * @throws \Flowpack\ElasticSearch\Exception |
371 | 375 | */ |
372 | 376 | public function updateIndexAlias(): void |
373 | 377 | { |
|
0 commit comments