diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-08-27 15:25:20 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-08-27 15:25:20 +0300 |
commit | d0ddead3dbf4fce9d1668aa85ef4f7c2918c46c7 (patch) | |
tree | 2f61b31e849a6aab130e1d3f4b07b7f38ddc971a /lib | |
parent | ae9c89285b0c1bd48682479d298e7df11668ff69 (diff) |
no chunks and displaying indexed document
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Exceptions/NotIndexableDocumentException.php | 32 | ||||
-rw-r--r-- | lib/Service/IndexService.php | 17 |
2 files changed, 40 insertions, 9 deletions
diff --git a/lib/Exceptions/NotIndexableDocumentException.php b/lib/Exceptions/NotIndexableDocumentException.php new file mode 100644 index 0000000..8f456d4 --- /dev/null +++ b/lib/Exceptions/NotIndexableDocumentException.php @@ -0,0 +1,32 @@ +<?php +/** + * FullTextSearch - Full text search framework for Nextcloud + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2018 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\FullTextSearch\Exceptions; + +class NotIndexableDocumentException extends \Exception { + +} + diff --git a/lib/Service/IndexService.php b/lib/Service/IndexService.php index 467bb84..3e2567a 100644 --- a/lib/Service/IndexService.php +++ b/lib/Service/IndexService.php @@ -32,6 +32,7 @@ use OCA\FullTextSearch\Exceptions\DatabaseException; use OCA\FullTextSearch\Exceptions\IndexDoesNotExistException; use OCA\FullTextSearch\Exceptions\InterruptException; use OCA\FullTextSearch\Exceptions\NoResultException; +use OCA\FullTextSearch\Exceptions\NotIndexableDocumentException; use OCA\FullTextSearch\Exceptions\TickDoesNotExistException; use OCA\FullTextSearch\IFullTextSearchPlatform; use OCA\FullTextSearch\IFullTextSearchProvider; @@ -66,6 +67,9 @@ class IndexService { /** @var array */ private $queuedDeleteIndex = []; + /** @var int */ + private $currentTotalDocuments = 0; + /** * IndexService constructor. @@ -159,24 +163,19 @@ class IndexService { ); $documents = $provider->generateIndexableDocuments($userId); + $this->currentTotalDocuments = sizeof($documents); $this->updateRunnerInfoArray( [ - 'documentTotal' => sizeof($documents), - 'documentLeft' => '' + 'documentTotal' => $this->currentTotalDocuments, + 'documentCurrent' => 0 ] ); //$maxSize = sizeof($documents); $toIndex = $this->updateDocumentsWithCurrIndex($provider, $documents, $options); - $this->indexChunks($platform, $provider, $toIndex, $options); - -// $this->updateRunnerInfoArray( -// [ -// 'documentLeft' => 0 -// ] -// ); + $this->indexDocuments($platform, $provider, $toIndex, $options); } |