|
18 | 18 | use Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient; |
19 | 19 | use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception; |
20 | 20 | use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\QueryBuildingException; |
| 21 | +use Flowpack\ElasticSearch\Domain\Model\Index; |
21 | 22 | use Flowpack\ElasticSearch\Domain\Model\Mapping; |
22 | 23 | use Neos\Flow\Log\ThrowableStorageInterface; |
23 | 24 | use Neos\Flow\Log\Utility\LogEnvironment; |
@@ -590,7 +591,7 @@ public function fetch(): array |
590 | 591 |
|
591 | 592 | $this->result['nodes'] = []; |
592 | 593 |
|
593 | | - $this->logThisQuery && $this->logger->debug(sprintf('Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s', $this->logMessage, $request, (($timeAfterwards - $timeBefore) * 1000), $this->limit, count($searchResult->getHits()), $searchResult->getTotal()), LogEnvironment::fromMethodName(__METHOD__)); |
| 594 | + $this->logThisQuery && $this->logger->debug(sprintf('Query Log (%s): Indexname: %s %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s', $this->logMessage, $this->getIndexName(), $request, (($timeAfterwards - $timeBefore) * 1000), $this->limit, count($searchResult->getHits()), $searchResult->getTotal()), LogEnvironment::fromMethodName(__METHOD__)); |
594 | 595 |
|
595 | 596 | if (count($searchResult->getHits()) > 0) { |
596 | 597 | $this->result['nodes'] = $this->convertHitsToNodes($searchResult->getHits()); |
@@ -661,7 +662,7 @@ public function count(): int |
661 | 662 | $treatedContent = $response->getTreatedContent(); |
662 | 663 | $count = (int)$treatedContent['count']; |
663 | 664 |
|
664 | | - $this->logThisQuery && $this->logger->debug('Count Query Log (' . $this->logMessage . '): ' . $request . ' -- execution time: ' . (($timeAfterwards - $timeBefore) * 1000) . ' ms -- Total Results: ' . $count, LogEnvironment::fromMethodName(__METHOD__)); |
| 665 | + $this->logThisQuery && $this->logger->debug('Count Query Log (' . $this->logMessage . '): ' . 'Indexname: ' . $this->getIndexName() . ' ' . $request . ' -- execution time: ' . (($timeAfterwards - $timeBefore) * 1000) . ' ms -- Total Results: ' . $count, LogEnvironment::fromMethodName(__METHOD__)); |
665 | 666 |
|
666 | 667 | return $count; |
667 | 668 | } |
@@ -1006,4 +1007,14 @@ protected function convertValue($value) |
1006 | 1007 |
|
1007 | 1008 | return $value; |
1008 | 1009 | } |
| 1010 | + |
| 1011 | + /** |
| 1012 | + * Retrieve the indexname |
| 1013 | + * |
| 1014 | + * @return string |
| 1015 | + */ |
| 1016 | + public function getIndexName(): string |
| 1017 | + { |
| 1018 | + return $this->elasticSearchClient->getIndexName(); |
| 1019 | + } |
1009 | 1020 | } |
0 commit comments