Commit | Line | Data |
---|---|---|
b52f751b AE |
1 | <?php |
2 | namespace wcf\system\search; | |
3 | use wcf\system\database\util\PreparedStatementConditionBuilder; | |
4 | ||
5 | /** | |
6 | * Default interface for search engines. | |
7 | * | |
8 | * @author Alexander Ebert | |
c839bd49 | 9 | * @copyright 2001-2018 WoltLab GmbH |
b52f751b | 10 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 11 | * @package WoltLabSuite\Core\System\Search |
b52f751b AE |
12 | */ |
13 | interface ISearchEngine { | |
0cd425be AE |
14 | /** |
15 | * Returns the condition builder class name required to provide conditions for getInnerJoin(). | |
16 | * | |
17 | * @return string | |
18 | */ | |
19 | public function getConditionBuilderClassName(); | |
20 | ||
21 | /** | |
0496fe5c AE |
22 | * Returns the inner join query and the condition parameters. This method is allowed to return NULL for both the |
23 | * 'fulltextCondition' and 'searchIndexCondition' index instead of a PreparedStatementConditionBuilder instance: | |
0cd425be AE |
24 | * |
25 | * array( | |
26 | * 'fulltextCondition' => $fulltextCondition || null, | |
0496fe5c | 27 | * 'searchIndexCondition' => $searchIndexCondition || null, |
0cd425be AE |
28 | * 'sql' => $sql |
29 | * ); | |
30 | * | |
4e25add7 MS |
31 | * @param string $objectTypeName |
32 | * @param string $q | |
33 | * @param boolean $subjectOnly | |
34 | * @param PreparedStatementConditionBuilder $searchIndexCondition | |
35 | * @param string $orderBy | |
36 | * @param integer $limit | |
0cd425be AE |
37 | * @return array |
38 | */ | |
39 | public function getInnerJoin($objectTypeName, $q, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, $orderBy = 'time DESC', $limit = 1000); | |
40 | ||
11767746 AE |
41 | /** |
42 | * Removes engine-specific special characters from a string. | |
43 | * | |
44 | * @param string $string | |
45 | */ | |
46 | public function removeSpecialCharacters($string); | |
47 | ||
b52f751b AE |
48 | /** |
49 | * Searches for the given string and returns the data of the found messages. | |
1a6e8c52 | 50 | * |
4e25add7 MS |
51 | * @param string $q |
52 | * @param array $objectTypes | |
53 | * @param boolean $subjectOnly | |
54 | * @param PreparedStatementConditionBuilder $searchIndexCondition | |
55 | * @param array $additionalConditions | |
56 | * @param string $orderBy | |
57 | * @param integer $limit | |
b52f751b AE |
58 | * @return array |
59 | */ | |
058cbd6a | 60 | public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = [], $orderBy = 'time DESC', $limit = 1000); |
b52f751b | 61 | } |