/** @var array Feature values */
protected $features = [];
- /** @const string profile type for completionSearch */
+ /** Profile type for completionSearch */
const COMPLETION_PROFILE_TYPE = 'completionSearchProfile';
- /** @const string profile type for query independent ranking features */
+ /** Profile type for query independent ranking features */
const FT_QUERY_INDEP_PROFILE_TYPE = 'fulltextQueryIndepProfile';
- /** @const int flag for legalSearchChars: includes all chars allowed in a search query */
+ /** Integer flag for legalSearchChars: includes all chars allowed in a search query */
const CHARS_ALL = 1;
- /** @const int flag for legalSearchChars: includes all chars allowed in a search term */
+ /** Integer flag for legalSearchChars: includes all chars allowed in a search term */
const CHARS_NO_SYNTAX = 2;
/**
* @return Title
*/
public static function getNearMatch( $searchterm ) {
+ wfDeprecated( __METHOD__, '1.27' );
+
return static::defaultNearMatcher()->getNearMatch( $searchterm );
}
/**
* Get chars legal for search
- * NOTE: usage as static is deprecated and preserved only as BC measure
* @param int $type type of search chars (see self::CHARS_ALL
* and self::CHARS_NO_SYNTAX). Defaults to CHARS_ALL
* @return string
*/
- public static function legalSearchChars( $type = self::CHARS_ALL ) {
+ public function legalSearchChars( $type = self::CHARS_ALL ) {
return "A-Za-z_'.0-9\\x80-\\xFF\\-";
}
function setNamespaces( $namespaces ) {
if ( $namespaces ) {
// Filter namespaces to only keep valid ones
- $validNs = $this->searchableNamespaces();
+ $validNs = MediaWikiServices::getInstance()->getSearchEngineConfig()->searchableNamespaces();
$namespaces = array_filter( $namespaces, function ( $ns ) use( $validNs ) {
return $ns < 0 || isset( $validNs[$ns] );
} );
* @return array
*/
public static function searchableNamespaces() {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineConfig()->searchableNamespaces();
}
* @return array
*/
public static function userNamespaces( $user ) {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineConfig()->userNamespaces( $user );
}
* @return array
*/
public static function defaultNamespaces() {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineConfig()->defaultNamespaces();
}
* @return array
*/
public static function namespacesAsText( $namespaces ) {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineConfig()->namespacesAsText( $namespaces );
}
* @return SearchEngine
*/
public static function create( $type = null ) {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineFactory()->create( $type );
}
* @return array
*/
public static function getSearchTypes() {
+ wfDeprecated( __METHOD__, '1.27' );
+
return MediaWikiServices::getInstance()->getSearchEngineConfig()->getSearchTypes();
}
}
}
}
-
-/**
- * Dummy class to be used when non-supported Database engine is present.
- * @todo FIXME: Dummy class should probably try something at least mildly useful,
- * such as a LIKE search through titles.
- * @ingroup Search
- */
-class SearchEngineDummy extends SearchEngine {
- // no-op
-}