}
/**
- * Get chars legal for search.
+ * Get chars legal for search (at query time).
* NOTE: usage as static is deprecated and preserved only as BC measure
* @return string
*/
return "A-Za-z_'.0-9\\x80-\\xFF\\-";
}
+ /**
+ * Get chars legal for search (at index time).
+ *
+ * @since 1.30
+ * @return string
+ */
+ public function legalSearchCharsForUpdate() {
+ return static::legalSearchChars();
+ }
+
/**
* Set the maximum number of results to return
* and how many to skip before returning the first.
if ( $namespaces ) {
// Filter namespaces to only keep valid ones
$validNs = $this->searchableNamespaces();
- $namespaces = array_filter( $namespaces, function( $ns ) use( $validNs ) {
+ $namespaces = array_filter( $namespaces, function ( $ns ) use( $validNs ) {
return $ns < 0 || isset( $validNs[$ns] );
} );
} else {
}
}
- $ns = array_map( function( $space ) {
+ $ns = array_map( function ( $space ) {
return $space == NS_MEDIA ? NS_FILE : $space;
}, $ns );
* @return Title[]
*/
public function extractTitles( SearchSuggestionSet $completionResults ) {
- return $completionResults->map( function( SearchSuggestion $sugg ) {
+ return $completionResults->map( function ( SearchSuggestion $sugg ) {
return $sugg->getSuggestedTitle();
} );
}
protected function processCompletionResults( $search, SearchSuggestionSet $suggestions ) {
$search = trim( $search );
// preload the titles with LinkBatch
- $titles = $suggestions->map( function( SearchSuggestion $sugg ) {
+ $titles = $suggestions->map( function ( SearchSuggestion $sugg ) {
return $sugg->getSuggestedTitle();
} );
$lb = new LinkBatch( $titles );
$lb->setCaller( __METHOD__ );
$lb->execute();
- $results = $suggestions->map( function( SearchSuggestion $sugg ) {
+ $results = $suggestions->map( function ( SearchSuggestion $sugg ) {
return $sugg->getSuggestedTitle()->getPrefixedText();
} );