diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-06-08 13:13:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-08 13:13:26 +0300 |
commit | 8a61e0d0c6f35e6352019e307cfce6d98c2f8cf1 (patch) | |
tree | 673c9f95cd861a5257153c238e77eec3b82d1a10 | |
parent | a4c95eaf7633aa391c0a4ebd41948d24335576c9 (diff) | |
parent | 08ca42fb40345ab2758a5d0e5e2991eabd3b8498 (diff) |
Merge pull request #512 from nextcloud/improvement/noid/getindex-on-each-loop
getIndex
-rw-r--r-- | lib/Service/IndexService.php | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/lib/Service/IndexService.php b/lib/Service/IndexService.php index 3193a21..3d1582b 100644 --- a/lib/Service/IndexService.php +++ b/lib/Service/IndexService.php @@ -218,9 +218,7 @@ class IndexService implements IIndexService { private function updateDocumentsWithCurrIndex( IFullTextSearchProvider $provider, array $documents, IIndexOptions $options ): array { - if (!$options->getOptionBool('test_request', false)) { - $currIndex = $this->getProviderIndexFromProvider($provider->getId()); - } + $result = []; $count = 0; foreach ($documents as $document) { @@ -232,13 +230,8 @@ class IndexService implements IIndexService { $count++; try { - if ($options->getOptionBool('test_request', false)) { - $index = $this->indexesRequest->getIndex( - $document->getProviderId(), $document->getId() - ); - } else { - $index = $currIndex->getIndex($document->getId()); - } + $index = + $this->indexesRequest->getIndex($document->getProviderId(), $document->getId()); } catch (IndexDoesNotExistException $e) { $index = new Index($document->getProviderId(), $document->getId()); $index->setStatus(Index::INDEX_FULL); @@ -287,18 +280,6 @@ class IndexService implements IIndexService { /** - * @param string $providerId - * - * @return ProviderIndexes - */ - private function getProviderIndexFromProvider(string $providerId): ProviderIndexes { - $indexes = $this->indexesRequest->getIndexesFromProvider($providerId); - - return new ProviderIndexes($indexes); - } - - - /** * @param IFullTextSearchPlatform $platform * @param IFullTextSearchProvider $provider * @param IIndexDocument[] $documents |