From bfe07293d4782aa4eb1a2b99ab0c003bae3ed42f Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 4 Feb 2026 17:13:30 +0100 Subject: [PATCH] fix(Command): try to actualize values for document indexing Signed-off-by: Maksim Sukharev --- lib/Command/DocumentIndex.php | 5 +++++ lib/Command/DocumentProvider.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/Command/DocumentIndex.php b/lib/Command/DocumentIndex.php index af512d68..f42d4b97 100644 --- a/lib/Command/DocumentIndex.php +++ b/lib/Command/DocumentIndex.php @@ -57,6 +57,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $index = new Index($providerId, $documentId); $index->setOwnerId($userId); $index->setStatus(Index::INDEX_FULL); + try { + $index = \OC::$server->get(\OCA\FullTextSearch\Service\IndexService::class)->getIndex($providerId, $documentId); + } catch (\Throwable $t) { + $output->writeln("Index not found : index attribute has been set to default values"); + } $indexDocument = $provider->updateDocument($index); if (!$indexDocument->hasIndex()) { $indexDocument->setIndex($index); diff --git a/lib/Command/DocumentProvider.php b/lib/Command/DocumentProvider.php index 9ab76276..70052831 100644 --- a/lib/Command/DocumentProvider.php +++ b/lib/Command/DocumentProvider.php @@ -58,6 +58,11 @@ protected function execute(InputInterface $input, OutputInterface $output) { $index = new Index($providerId, $documentId); $index->setOwnerId($userId); $index->setStatus(Index::INDEX_FULL); + try { + $index = \OC::$server->get(\OCA\FullTextSearch\Service\IndexService::class)->getIndex($providerId, $documentId); + } catch (\Throwable $t) { + $output->writeln("Index not found : index attribute has been set to default values"); + } $indexDocument = $provider->updateDocument($index); $index->setOwnerId($indexDocument->getAccess()->getOwnerId());