Merge commit '8737640341f72bd78f5ebabc0d9c46e1541274c5'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / search / ISearchEngine.class.php
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
9 * @copyright 2001-2014 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package com.woltlab.wcf
12 * @subpackage system.search
13 * @category Community Framework
14 */
15 interface ISearchEngine {
16 /**
17 * Returns the condition builder class name required to provide conditions for getInnerJoin().
18 *
19 * @return string
20 */
21 public function getConditionBuilderClassName();
22
23 /**
24 * Returns the inner join query and the condition parameters. This method is allowed to return NULL for both the
25 * 'fulltextCondition' and 'searchIndexCondition' index instead of a PreparedStatementConditionBuilder instance:
26 *
27 * array(
28 * 'fulltextCondition' => $fulltextCondition || null,
29 * 'searchIndexCondition' => $searchIndexCondition || null,
30 * 'sql' => $sql
31 * );
32 *
33 * @param string $objectTypeName
34 * @param string $q
35 * @param boolean $subjectOnly
36 * @param \wcf\system\database\util\PreparedStatementConditionBuilder $searchIndexCondition
37 * @param string $orderBy
38 * @param integer $limit
39 * @return array
40 */
41 public function getInnerJoin($objectTypeName, $q, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, $orderBy = 'time DESC', $limit = 1000);
42
43 /**
44 * Removes engine-specific special characters from a string.
45 *
46 * @param string $string
47 */
48 public function removeSpecialCharacters($string);
49
50 /**
51 * Searches for the given string and returns the data of the found messages.
52 *
53 * @param string $q
54 * @param array $objectTypes
55 * @param boolean $subjectOnly
56 * @param \wcf\system\database\util\PreparedStatementConditionBuilder $searchIndexCondition
57 * @param array $additionalConditions
58 * @param string $orderBy
59 * @param integer $limit
60 * @return array
61 */
62 public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = array(), $orderBy = 'time DESC', $limit = 1000);
63 }