Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2021 (original work) Open Assessment Technologies SA; * |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\tao\model\search; |
| 24 | |
| 25 | use oat\oatbox\PhpSerializable; |
| 26 | use oat\tao\model\search\index\IndexIterator; |
| 27 | |
| 28 | interface SearchInterface extends PhpSerializable |
| 29 | { |
| 30 | /** |
| 31 | * Search for instances using a Lucene query |
| 32 | * |
| 33 | * @param string $queryString |
| 34 | * @param string $type |
| 35 | * @param int $start |
| 36 | * @param int $count |
| 37 | * @param string $order |
| 38 | * @param string $dir |
| 39 | * |
| 40 | * @return ResultSet |
| 41 | */ |
| 42 | public function query($queryString, $type, $start = 0, $count = 10, $order = 'id', $dir = 'DESC'); |
| 43 | |
| 44 | /** |
| 45 | * Delete all indexes |
| 46 | */ |
| 47 | public function flush(); |
| 48 | |
| 49 | /** |
| 50 | * (Re)Generate the index for a given document |
| 51 | * If index is already exist, then it will merge the fields in index with the existing document |
| 52 | * |
| 53 | * @param IndexIterator|array $documents |
| 54 | * @return int count of indexed documents |
| 55 | */ |
| 56 | public function index($documents); |
| 57 | |
| 58 | /** |
| 59 | * Remove a resource from the index |
| 60 | * |
| 61 | * @param string $resourceId |
| 62 | * @return boolean true if successfully removed |
| 63 | */ |
| 64 | public function remove($resourceId); |
| 65 | |
| 66 | /** |
| 67 | * Whenever or not the current implementation supports |
| 68 | * custom indexes |
| 69 | * |
| 70 | * @return boolean |
| 71 | */ |
| 72 | public function supportCustomIndex(); |
| 73 | } |