* Transform search term in cases when parts of the query came as different
* GET params (when supported), e.g. for prefix queries:
* search=test&prefix=Main_Page/Archive -> test prefix:Main Page/Archive
+ * @param string $term
+ * @return string
*/
function transformSearchTerm( $term ) {
return $term;
/**
* Really find the title match.
+ * @param string $searchterm
* @return null|Title
*/
private static function getNearMatchInternal( $searchterm ) {
$parsed = $query;
if ( strpos( $query, ':' ) === false ) { // nothing to do
- wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) );
return $parsed;
}
$parsed = $query; // prefix was the whole query
}
- wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) );
-
return $parsed;
}
* @return array
*/
public static function userNamespaces( $user ) {
- global $wgSearchEverythingOnlyLoggedIn;
-
- $searchableNamespaces = SearchEngine::searchableNamespaces();
-
- // get search everything preference, that can be set to be read for logged-in users
- // it overrides other options
- if ( !$wgSearchEverythingOnlyLoggedIn || $user->isLoggedIn() ) {
- if ( $user->getOption( 'searcheverything' ) ) {
- return array_keys( $searchableNamespaces );
- }
- }
-
$arr = array();
- foreach ( $searchableNamespaces as $ns => $name ) {
+ foreach ( SearchEngine::searchableNamespaces() as $ns => $name ) {
if ( $user->getOption( 'searchNs' . $ns ) ) {
$arr[] = $ns;
}
return $formatted;
}
- /**
- * Return a 'cleaned up' search string
- *
- * @param string $text
- * @return string
- */
- function filter( $text ) {
- $lc = $this->legalSearchChars();
- return trim( preg_replace( "/[^{$lc}]/", " ", $text ) );
- }
-
/**
* Load up the appropriate search engine class for the currently
* active database backend, and return a configured instance.
}
}
-/**
- * @ingroup Search
- */
-class SearchResultTooMany {
- # # Some search engines may bail out if too many matches are found
-}
-
/**
* Dummy class to be used when non-supported Database engine is present.
* @todo FIXME: Dummy class should probably try something at least mildly useful,