r45216 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45215‎ | r45216 | r45217 >
Date:03:37, 31 December 2008
Author:rainman
Status:ok
Tags:
Comment:
Paired to previous commit: prefix is used by lucene backend to limit searches to pages of certain prefix.
Useful in e.g. searching talk page archieves.
Modified paths:
  • /trunk/extensions/MWSearch/MWSearch_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MWSearch/MWSearch_body.php
@@ -162,6 +162,17 @@
163163 function acceptListRedirects() {
164164 return false;
165165 }
 166+
 167+ /** Merge the prefix into the query (if any) */
 168+ function transformSearchTerm( $term ) {
 169+ global $wgLuceneSearchVersion;
 170+
 171+ if ( $wgLuceneSearchVersion >= 2.1 && $this->prefix != '' ){
 172+ # convert to internal backend prefix notation
 173+ $term = $term.' prefix:'.$this->prefix;
 174+ }
 175+ return $term;
 176+ }
166177 }
167178
168179 class LuceneResult extends SearchResult {
@@ -439,6 +450,7 @@
440451 * @param string $method The protocol verb to use
441452 * @param string $query
442453 * @param int $limit
 454+ * @param int $offset
443455 * @return array
444456 * @access public
445457 */

Status & tagging log