diff --git a/src/store/src/Command/IndexCommand.php b/src/store/src/Command/IndexCommand.php index 97ae1fae9..1d70a5e10 100644 --- a/src/store/src/Command/IndexCommand.php +++ b/src/store/src/Command/IndexCommand.php @@ -96,6 +96,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io->title(\sprintf('Indexing documents using "%s" indexer', $indexer)); + $description = $indexerService->getDescription(); + if (null !== $description) { + $io->info($description); + } + try { $indexerService->index([]); diff --git a/src/store/src/Indexer.php b/src/store/src/Indexer.php index e368ba178..c541be318 100644 --- a/src/store/src/Indexer.php +++ b/src/store/src/Indexer.php @@ -39,6 +39,7 @@ public function __construct( private StoreInterface $store, string|array|null $source = null, private array $transformers = [], + private ?string $description = null, private LoggerInterface $logger = new NullLogger(), ) { $this->sources = null === $source ? [] : (array) $source; @@ -46,7 +47,7 @@ public function __construct( public function withSource(string|array $source): self { - return new self($this->loader, $this->vectorizer, $this->store, $source, $this->transformers, $this->logger); + return new self($this->loader, $this->vectorizer, $this->store, $source, $this->transformers, $this->description, $this->logger); } public function index(array $options = []): void @@ -96,6 +97,11 @@ public function index(array $options = []): void $this->logger->debug('Document processing completed', ['total_documents' => $counter]); } + public function getDescription(): ?string + { + return $this->description; + } + /** * @return TextDocument[] */ diff --git a/src/store/src/IndexerInterface.php b/src/store/src/IndexerInterface.php index fcb27494f..b4e2c9863 100644 --- a/src/store/src/IndexerInterface.php +++ b/src/store/src/IndexerInterface.php @@ -31,4 +31,9 @@ public function index(array $options = []): void; * @param string|array $source Source identifier (file path, URL, etc.) or array of sources */ public function withSource(string|array $source): self; + + /** + * Get the description of what this indexer does. + */ + public function getDescription(): ?string; }