return true;
}
+ /**
+ * 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
+ */
+ function transformSearchTerm( $term ) {
+ return $term;
+ }
+
/**
* If an exact title match can be find, or a very slightly close match,
* return the title. If no match, returns NULL.
*/
function __construct( &$request, &$user ) {
list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, 'searchlimit' );
+ $this->mPrefix = $request->getVal('prefix', '');
# Extract requested namespaces
$this->namespaces = $this->powerSearch( $request );
if( empty( $this->namespaces ) ) {
$search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
$search->showRedirects = $this->searchRedirects;
+ $search->prefix = $this->mPrefix;
+ $term = $search->transformSearchTerm($term);
$rewritten = $search->replacePrefixes($term);
$titleMatches = $search->searchTitle( $rewritten );