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 | namespace CirrusSearch\Sanity; |
4 | |
5 | use MediaWiki\Title\Title; |
6 | use WikiPage; |
7 | |
8 | /** |
9 | * Remediation actions for insanity in the search index. |
10 | * |
11 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by |
13 | * the Free Software Foundation; either version 2 of the License, or |
14 | * (at your option) any later version. |
15 | * |
16 | * This program is distributed in the hope that it will be useful, |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | * GNU General Public License for more details. |
20 | * |
21 | * You should have received a copy of the GNU General Public License along |
22 | * with this program; if not, write to the Free Software Foundation, Inc., |
23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 | * http://www.gnu.org/copyleft/gpl.html |
25 | */ |
26 | |
27 | interface Remediator { |
28 | /** |
29 | * There is a redirect in the index. |
30 | * @param string $docId elasticsearch document id of the redirected page |
31 | * @param WikiPage $page the page in the index |
32 | * @param string $indexSuffix The index suffix it was found in |
33 | */ |
34 | public function redirectInIndex( string $docId, WikiPage $page, string $indexSuffix ); |
35 | |
36 | /** |
37 | * A page isn't in the index. |
38 | * @param WikiPage $page not in the index |
39 | */ |
40 | public function pageNotInIndex( WikiPage $page ); |
41 | |
42 | /** |
43 | * A non-existent page is in the index. Odds are good it was deleted. |
44 | * |
45 | * @param string $docId elasticsearch document id of the deleted page |
46 | * @param Title $title title of the page read from the ghost |
47 | */ |
48 | public function ghostPageInIndex( $docId, Title $title ); |
49 | |
50 | /** |
51 | * An existent page is in more then one index. |
52 | * |
53 | * @param string $docId elasticsearch document id |
54 | * @param WikiPage $page page in too many indexes |
55 | * @param string $indexSuffix index suffix that the page is in but shouldn't be in |
56 | */ |
57 | public function pageInWrongIndex( $docId, WikiPage $page, $indexSuffix ); |
58 | |
59 | /** |
60 | * @param string $docId elasticsearch document id |
61 | * @param WikiPage $page page with outdated document in index |
62 | * @param string $indexSuffix index contgaining outdated document |
63 | */ |
64 | public function oldVersionInIndex( $docId, WikiPage $page, $indexSuffix ); |
65 | |
66 | /** |
67 | * @param WikiPage $page Page considered too old in index |
68 | */ |
69 | public function oldDocument( WikiPage $page ); |
70 | } |