Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stable15' into stable15
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jun 8, 2019
2 parents dea8d36 + 07540bf commit 462ad76
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions lib/Service/IndexService.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function indexProviderContentFromUser(
private function updateDocumentsWithCurrIndex(
IFullTextSearchProvider $provider, array $documents, IIndexOptions $options
): array {
$currIndex = $this->getProviderIndexFromProvider($provider->getId());

$result = [];
$count = 0;
foreach ($documents as $document) {
Expand All @@ -218,7 +218,8 @@ private function updateDocumentsWithCurrIndex(
$count++;

try {
$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);
Expand Down Expand Up @@ -267,18 +268,6 @@ private function isDocumentUpToDate(IFullTextSearchProvider $provider, IndexDocu
}


/**
* @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
Expand Down

0 comments on commit 462ad76

Please sign in to comment.