*/
protected $conditionBuilderClassName = 'wcf\system\database\util\PreparedStatementConditionBuilder';
+ /**
+ * list of engine-specific special characters
+ * @var array<string>
+ */
+ protected $specialCharacters = array();
+
/**
* @see \wcf\system\search\ISearchEngine::getConditionBuilderClassName()
*/
* @return integer
*/
abstract protected function getFulltextMinimumWordLength();
+
+ /**
+ * @see \wcf\system\search\ISearchEngine::removeSpecialCharacters()
+ */
+ public function removeSpecialCharacters($string) {
+ if (!empty($this->specialCharacters)) {
+ return str_replace($this->specialCharacters, '', $string);
+ }
+
+ return $string;
+ }
}
*/
public function getInnerJoin($objectTypeName, $q, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, $orderBy = 'time DESC', $limit = 1000);
+ /**
+ * Removes engine-specific special characters from a string.
+ *
+ * @param string $string
+ */
+ public function removeSpecialCharacters($string);
+
/**
* Searches for the given string and returns the data of the found messages.
*
public function getConditionBuilderClassName() {
return $this->getSearchEngine()->getConditionBuilderClassName();
}
+
+ /**
+ * @see \wcf\system\search\ISearchEngine::removeSpecialCharacters()
+ */
+ public function removeSpecialCharacters($string) {
+ return $this->getSearchEngine()->removeSpecialCharacters($string);
+ }
}
*/
protected $ftMinWordLen = null;
+ /**
+ * @see \wcf\system\search\AbstractSearchEngine::$specialCharacters
+ */
+ protected $specialCharacters = array('(', ')', '@', '+', '-', '"', '<', '>', '~', '*');
+
/**
* @see \wcf\system\search\ISearchEngine::search()
*/