Index: trunk/phase3/includes/SearchEngine.php |
— | — | @@ -21,11 +21,10 @@ |
22 | 22 | /** |
23 | 23 | * Perform a full text search query and return a result set. |
24 | 24 | * If title searches are not supported or disabled, return null. |
| 25 | + * STUB |
25 | 26 | * |
26 | | - * @param string $term - Raw search term |
| 27 | + * @param $term String: raw search term |
27 | 28 | * @return SearchResultSet |
28 | | - * @access public |
29 | | - * @abstract |
30 | 29 | */ |
31 | 30 | function searchText( $term ) { |
32 | 31 | return null; |
— | — | @@ -34,11 +33,10 @@ |
35 | 34 | /** |
36 | 35 | * Perform a title-only search query and return a result set. |
37 | 36 | * If title searches are not supported or disabled, return null. |
| 37 | + * STUB |
38 | 38 | * |
39 | | - * @param string $term - Raw search term |
| 39 | + * @param $term String: raw search term |
40 | 40 | * @return SearchResultSet |
41 | | - * @access public |
42 | | - * @abstract |
43 | 41 | */ |
44 | 42 | function searchTitle( $term ) { |
45 | 43 | return null; |
— | — | @@ -61,7 +59,7 @@ |
62 | 60 | * If an exact title match can be find, or a very slightly close match, |
63 | 61 | * return the title. If no match, returns NULL. |
64 | 62 | * |
65 | | - * @param string $term |
| 63 | + * @param $searchterm String |
66 | 64 | * @return Title |
67 | 65 | */ |
68 | 66 | public static function getNearMatch( $searchterm ) { |
— | — | @@ -171,9 +169,8 @@ |
172 | 170 | * Set the maximum number of results to return |
173 | 171 | * and how many to skip before returning the first. |
174 | 172 | * |
175 | | - * @param int $limit |
176 | | - * @param int $offset |
177 | | - * @access public |
| 173 | + * @param $limit Integer |
| 174 | + * @param $offset Integer |
178 | 175 | */ |
179 | 176 | function setLimitOffset( $limit, $offset = 0 ) { |
180 | 177 | $this->limit = intval( $limit ); |
— | — | @@ -184,8 +181,7 @@ |
185 | 182 | * Set which namespaces the search should include. |
186 | 183 | * Give an array of namespace index numbers. |
187 | 184 | * |
188 | | - * @param array $namespaces |
189 | | - * @access public |
| 185 | + * @param $namespaces Array |
190 | 186 | */ |
191 | 187 | function setNamespaces( $namespaces ) { |
192 | 188 | $this->namespaces = $namespaces; |
— | — | @@ -195,7 +191,7 @@ |
196 | 192 | * Parse some common prefixes: all (search everything) |
197 | 193 | * or namespace names |
198 | 194 | * |
199 | | - * @param string $query |
| 195 | + * @param $query String |
200 | 196 | */ |
201 | 197 | function replacePrefixes( $query ){ |
202 | 198 | global $wgContLang; |
— | — | @@ -224,7 +220,7 @@ |
225 | 221 | |
226 | 222 | /** |
227 | 223 | * Make a list of searchable namespaces and their canonical names. |
228 | | - * @return array |
| 224 | + * @return Array |
229 | 225 | */ |
230 | 226 | public static function searchableNamespaces() { |
231 | 227 | global $wgContLang; |
— | — | @@ -241,9 +237,8 @@ |
242 | 238 | * Extract default namespaces to search from the given user's |
243 | 239 | * settings, returning a list of index numbers. |
244 | 240 | * |
245 | | - * @param User $user |
246 | | - * @return array |
247 | | - * @static |
| 241 | + * @param $user User |
| 242 | + * @return Array |
248 | 243 | */ |
249 | 244 | public static function userNamespaces( &$user ) { |
250 | 245 | $arr = array(); |
— | — | @@ -258,9 +253,8 @@ |
259 | 254 | /** |
260 | 255 | * Find snippet highlight settings for a given user |
261 | 256 | * |
262 | | - * @param User $user |
263 | | - * @return array contextlines, contextchars |
264 | | - * @static |
| 257 | + * @param $user User |
| 258 | + * @return Array contextlines, contextchars |
265 | 259 | */ |
266 | 260 | public static function userHighlightPrefs( &$user ){ |
267 | 261 | //$contextlines = $user->getOption( 'contextlines', 5 ); |
— | — | @@ -273,8 +267,7 @@ |
274 | 268 | /** |
275 | 269 | * An array of namespaces indexes to be searched by default |
276 | 270 | * |
277 | | - * @return array |
278 | | - * @static |
| 271 | + * @return Array |
279 | 272 | */ |
280 | 273 | public static function defaultNamespaces(){ |
281 | 274 | global $wgNamespacesToBeSearchedDefault; |
— | — | @@ -286,7 +279,7 @@ |
287 | 280 | * Get a list of namespace names useful for showing in tooltips |
288 | 281 | * and preferences |
289 | 282 | * |
290 | | - * @param unknown_type $namespaces |
| 283 | + * @param $namespaces Array |
291 | 284 | */ |
292 | 285 | public static function namespacesAsText( $namespaces ){ |
293 | 286 | global $wgContLang; |
— | — | @@ -303,8 +296,7 @@ |
304 | 297 | * An array of "project" namespaces indexes typically searched |
305 | 298 | * by logged-in users |
306 | 299 | * |
307 | | - * @return array |
308 | | - * @static |
| 300 | + * @return Array |
309 | 301 | */ |
310 | 302 | public static function projectNamespaces() { |
311 | 303 | global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject; |
— | — | @@ -316,8 +308,7 @@ |
317 | 309 | * An array of "project" namespaces indexes typically searched |
318 | 310 | * by logged-in users in addition to the default namespaces |
319 | 311 | * |
320 | | - * @return array |
321 | | - * @static |
| 312 | + * @return Array |
322 | 313 | */ |
323 | 314 | public static function defaultAndProjectNamespaces() { |
324 | 315 | global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject; |
— | — | @@ -329,8 +320,8 @@ |
330 | 321 | /** |
331 | 322 | * Return a 'cleaned up' search string |
332 | 323 | * |
333 | | - * @return string |
334 | | - * @access public |
| 324 | + * @param $text String |
| 325 | + * @return String |
335 | 326 | */ |
336 | 327 | function filter( $text ) { |
337 | 328 | $lc = $this->legalSearchChars(); |
— | — | @@ -358,11 +349,11 @@ |
359 | 350 | /** |
360 | 351 | * Create or update the search index record for the given page. |
361 | 352 | * Title and text should be pre-processed. |
| 353 | + * STUB |
362 | 354 | * |
363 | | - * @param int $id |
364 | | - * @param string $title |
365 | | - * @param string $text |
366 | | - * @abstract |
| 355 | + * @param $id Integer |
| 356 | + * @param $title String |
| 357 | + * @param $text String |
367 | 358 | */ |
368 | 359 | function update( $id, $title, $text ) { |
369 | 360 | // no-op |
— | — | @@ -371,10 +362,10 @@ |
372 | 363 | /** |
373 | 364 | * Update a search index record's title only. |
374 | 365 | * Title should be pre-processed. |
| 366 | + * STUB |
375 | 367 | * |
376 | | - * @param int $id |
377 | | - * @param string $title |
378 | | - * @abstract |
| 368 | + * @param $id Integer |
| 369 | + * @param $title String |
379 | 370 | */ |
380 | 371 | function updateTitle( $id, $title ) { |
381 | 372 | // no-op |
— | — | @@ -383,8 +374,7 @@ |
384 | 375 | /** |
385 | 376 | * Get OpenSearch suggestion template |
386 | 377 | * |
387 | | - * @return string |
388 | | - * @static |
| 378 | + * @return String |
389 | 379 | */ |
390 | 380 | public static function getOpenSearchTemplate() { |
391 | 381 | global $wgOpenSearchTemplate, $wgServer, $wgScriptPath; |
— | — | @@ -400,8 +390,7 @@ |
401 | 391 | /** |
402 | 392 | * Get internal MediaWiki Suggest template |
403 | 393 | * |
404 | | - * @return string |
405 | | - * @static |
| 394 | + * @return String |
406 | 395 | */ |
407 | 396 | public static function getMWSuggestTemplate() { |
408 | 397 | global $wgMWSuggestTemplate, $wgServer, $wgScriptPath; |
— | — | @@ -419,10 +408,9 @@ |
420 | 409 | /** |
421 | 410 | * Fetch an array of regular expression fragments for matching |
422 | 411 | * the search terms as parsed by this engine in a text extract. |
| 412 | + * STUB |
423 | 413 | * |
424 | | - * @return array |
425 | | - * @access public |
426 | | - * @abstract |
| 414 | + * @return Array |
427 | 415 | */ |
428 | 416 | function termMatches() { |
429 | 417 | return array(); |
— | — | @@ -434,8 +422,9 @@ |
435 | 423 | |
436 | 424 | /** |
437 | 425 | * Return true if results are included in this result set. |
438 | | - * @return bool |
439 | | - * @abstract |
| 426 | + * STUB |
| 427 | + * |
| 428 | + * @return Boolean |
440 | 429 | */ |
441 | 430 | function hasResults() { |
442 | 431 | return false; |
— | — | @@ -449,8 +438,7 @@ |
450 | 439 | * |
451 | 440 | * Return null if no total hits number is supported. |
452 | 441 | * |
453 | | - * @return int |
454 | | - * @access public |
| 442 | + * @return Integer |
455 | 443 | */ |
456 | 444 | function getTotalHits() { |
457 | 445 | return null; |
— | — | @@ -460,22 +448,21 @@ |
461 | 449 | * Some search modes return a suggested alternate term if there are |
462 | 450 | * no exact hits. Returns true if there is one on this set. |
463 | 451 | * |
464 | | - * @return bool |
465 | | - * @access public |
| 452 | + * @return Boolean |
466 | 453 | */ |
467 | 454 | function hasSuggestion() { |
468 | 455 | return false; |
469 | 456 | } |
470 | 457 | |
471 | 458 | /** |
472 | | - * @return string suggested query, null if none |
| 459 | + * @return String: suggested query, null if none |
473 | 460 | */ |
474 | 461 | function getSuggestionQuery(){ |
475 | 462 | return null; |
476 | 463 | } |
477 | 464 | |
478 | 465 | /** |
479 | | - * @return string HTML highlighted suggested query, '' if none |
| 466 | + * @return String: HTML highlighted suggested query, '' if none |
480 | 467 | */ |
481 | 468 | function getSuggestionSnippet(){ |
482 | 469 | return ''; |
— | — | @@ -485,7 +472,7 @@ |
486 | 473 | * Return information about how and from where the results were fetched, |
487 | 474 | * should be useful for diagnostics and debugging |
488 | 475 | * |
489 | | - * @return string |
| 476 | + * @return String |
490 | 477 | */ |
491 | 478 | function getInfo() { |
492 | 479 | return null; |
— | — | @@ -503,7 +490,7 @@ |
504 | 491 | /** |
505 | 492 | * Check if there are results on other wikis |
506 | 493 | * |
507 | | - * @return boolean |
| 494 | + * @return Boolean |
508 | 495 | */ |
509 | 496 | function hasInterwikiResults() { |
510 | 497 | return $this->getInterwikiResults() != null; |
— | — | @@ -512,9 +499,9 @@ |
513 | 500 | |
514 | 501 | /** |
515 | 502 | * Fetches next search result, or false. |
| 503 | + * STUB |
| 504 | + * |
516 | 505 | * @return SearchResult |
517 | | - * @access public |
518 | | - * @abstract |
519 | 506 | */ |
520 | 507 | function next() { |
521 | 508 | return false; |
— | — | @@ -522,7 +509,6 @@ |
523 | 510 | |
524 | 511 | /** |
525 | 512 | * Frees the result set, if applicable. |
526 | | - * @ access public |
527 | 513 | */ |
528 | 514 | function free() { |
529 | 515 | // ... |
— | — | @@ -539,9 +525,9 @@ |
540 | 526 | |
541 | 527 | |
542 | 528 | /** |
543 | | - * @fixme This class is horribly factored. It would probably be better to have |
544 | | - * a useful base class to which you pass some standard information, then let |
545 | | - * the fancy self-highlighters extend that. |
| 529 | + * @todo Fixme: This class is horribly factored. It would probably be better to |
| 530 | + * have a useful base class to which you pass some standard information, then |
| 531 | + * let the fancy self-highlighters extend that. |
546 | 532 | * @ingroup Search |
547 | 533 | */ |
548 | 534 | class SearchResult { |
— | — | @@ -560,8 +546,7 @@ |
561 | 547 | /** |
562 | 548 | * Check if this is result points to an invalid title |
563 | 549 | * |
564 | | - * @return boolean |
565 | | - * @access public |
| 550 | + * @return Boolean |
566 | 551 | */ |
567 | 552 | function isBrokenTitle(){ |
568 | 553 | if( is_null($this->mTitle) ) |
— | — | @@ -572,8 +557,7 @@ |
573 | 558 | /** |
574 | 559 | * Check if target page is missing, happens when index is out of date |
575 | 560 | * |
576 | | - * @return boolean |
577 | | - * @access public |
| 561 | + * @return Boolean |
578 | 562 | */ |
579 | 563 | function isMissingRevision(){ |
580 | 564 | return !$this->mRevision && !$this->mImage; |
— | — | @@ -581,14 +565,13 @@ |
582 | 566 | |
583 | 567 | /** |
584 | 568 | * @return Title |
585 | | - * @access public |
586 | 569 | */ |
587 | 570 | function getTitle() { |
588 | 571 | return $this->mTitle; |
589 | 572 | } |
590 | 573 | |
591 | 574 | /** |
592 | | - * @return double or null if not supported |
| 575 | + * @return Double or null if not supported |
593 | 576 | */ |
594 | 577 | function getScore() { |
595 | 578 | return null; |
— | — | @@ -608,8 +591,8 @@ |
609 | 592 | } |
610 | 593 | |
611 | 594 | /** |
612 | | - * @param array $terms terms to highlight |
613 | | - * @return string highlighted text snippet, null (and not '') if not supported |
| 595 | + * @param $terms Array: terms to highlight |
| 596 | + * @return String: highlighted text snippet, null (and not '') if not supported |
614 | 597 | */ |
615 | 598 | function getTextSnippet($terms){ |
616 | 599 | global $wgUser, $wgAdvancedSearchHighlighting; |
— | — | @@ -623,16 +606,16 @@ |
624 | 607 | } |
625 | 608 | |
626 | 609 | /** |
627 | | - * @param array $terms terms to highlight |
628 | | - * @return string highlighted title, '' if not supported |
| 610 | + * @param $terms Array: terms to highlight |
| 611 | + * @return String: highlighted title, '' if not supported |
629 | 612 | */ |
630 | 613 | function getTitleSnippet($terms){ |
631 | 614 | return ''; |
632 | 615 | } |
633 | 616 | |
634 | 617 | /** |
635 | | - * @param array $terms terms to highlight |
636 | | - * @return string highlighted redirect name (redirect to this page), '' if none or not supported |
| 618 | + * @param $terms Array: terms to highlight |
| 619 | + * @return String: highlighted redirect name (redirect to this page), '' if none or not supported |
637 | 620 | */ |
638 | 621 | function getRedirectSnippet($terms){ |
639 | 622 | return ''; |
— | — | @@ -660,7 +643,7 @@ |
661 | 644 | } |
662 | 645 | |
663 | 646 | /** |
664 | | - * @return string timestamp |
| 647 | + * @return String: timestamp |
665 | 648 | */ |
666 | 649 | function getTimestamp(){ |
667 | 650 | if( $this->mRevision ) |
— | — | @@ -671,7 +654,7 @@ |
672 | 655 | } |
673 | 656 | |
674 | 657 | /** |
675 | | - * @return int number of words |
| 658 | + * @return Integer: number of words |
676 | 659 | */ |
677 | 660 | function getWordCount(){ |
678 | 661 | $this->initText(); |
— | — | @@ -679,7 +662,7 @@ |
680 | 663 | } |
681 | 664 | |
682 | 665 | /** |
683 | | - * @return int size in bytes |
| 666 | + * @return Integer: size in bytes |
684 | 667 | */ |
685 | 668 | function getByteSize(){ |
686 | 669 | $this->initText(); |
— | — | @@ -687,14 +670,14 @@ |
688 | 671 | } |
689 | 672 | |
690 | 673 | /** |
691 | | - * @return boolean if hit has related articles |
| 674 | + * @return Boolean if hit has related articles |
692 | 675 | */ |
693 | 676 | function hasRelated(){ |
694 | 677 | return false; |
695 | 678 | } |
696 | 679 | |
697 | 680 | /** |
698 | | - * @return interwiki prefix of the title (return iw even if title is broken) |
| 681 | + * @return String: interwiki prefix of the title (return iw even if title is broken) |
699 | 682 | */ |
700 | 683 | function getInterwikiPrefix(){ |
701 | 684 | return ''; |
— | — | @@ -716,11 +699,11 @@ |
717 | 700 | /** |
718 | 701 | * Default implementation of wikitext highlighting |
719 | 702 | * |
720 | | - * @param string $text |
721 | | - * @param array $terms Terms to highlight (unescaped) |
722 | | - * @param int $contextlines |
723 | | - * @param int $contextchars |
724 | | - * @return string |
| 703 | + * @param $text String |
| 704 | + * @param $terms Array: terms to highlight (unescaped) |
| 705 | + * @param $contextlines Integer |
| 706 | + * @param $contextchars Integer |
| 707 | + * @return String |
725 | 708 | */ |
726 | 709 | public function highlightText( $text, $terms, $contextlines, $contextchars ) { |
727 | 710 | global $wgLang, $wgContLang; |
— | — | @@ -958,9 +941,9 @@ |
959 | 942 | /** |
960 | 943 | * Split text into lines and add it to extracts array |
961 | 944 | * |
962 | | - * @param array $extracts index -> $line |
963 | | - * @param int $count |
964 | | - * @param string $text |
| 945 | + * @param $extracts Array: index -> $line |
| 946 | + * @param $count Integer |
| 947 | + * @param $text String |
965 | 948 | */ |
966 | 949 | function splitAndAdd(&$extracts, &$count, $text){ |
967 | 950 | $split = explode( "\n", $this->mCleanWikitext? $this->removeWiki($text) : $text ); |
— | — | @@ -974,7 +957,7 @@ |
975 | 958 | /** |
976 | 959 | * Do manual case conversion for non-ascii chars |
977 | 960 | * |
978 | | - * @param unknown_type $matches |
| 961 | + * @param $matches Array |
979 | 962 | */ |
980 | 963 | function caseCallback($matches){ |
981 | 964 | global $wgContLang; |
— | — | @@ -987,12 +970,12 @@ |
988 | 971 | /** |
989 | 972 | * Extract part of the text from start to end, but by |
990 | 973 | * not chopping up words |
991 | | - * @param string $text |
992 | | - * @param int $start |
993 | | - * @param int $end |
994 | | - * @param int $posStart (out) actual start position |
995 | | - * @param int $posEnd (out) actual end position |
996 | | - * @return string |
| 974 | + * @param $text String |
| 975 | + * @param $start Integer |
| 976 | + * @param $end Integer |
| 977 | + * @param $posStart Integer: (out) actual start position |
| 978 | + * @param $posEnd Integer: (out) actual end position |
| 979 | + * @return String |
997 | 980 | */ |
998 | 981 | function extract($text, $start, $end, &$posStart = null, &$posEnd = null ){ |
999 | 982 | global $wgContLang; |
— | — | @@ -1018,10 +1001,10 @@ |
1019 | 1002 | /** |
1020 | 1003 | * Find a nonletter near a point (index) in the text |
1021 | 1004 | * |
1022 | | - * @param string $text |
1023 | | - * @param int $point |
1024 | | - * @param int $offset to found index |
1025 | | - * @return int nearest nonletter index, or beginning of utf8 char if none |
| 1005 | + * @param $text String |
| 1006 | + * @param $point Integer |
| 1007 | + * @param $offset Integer: offset to found index |
| 1008 | + * @return Integer: nearest nonletter index, or beginning of utf8 char if none |
1026 | 1009 | */ |
1027 | 1010 | function position($text, $point, $offset=0 ){ |
1028 | 1011 | $tolerance = 10; |
— | — | @@ -1048,12 +1031,12 @@ |
1049 | 1032 | /** |
1050 | 1033 | * Search extracts for a pattern, and return snippets |
1051 | 1034 | * |
1052 | | - * @param string $pattern regexp for matching lines |
1053 | | - * @param array $extracts extracts to search |
1054 | | - * @param int $linesleft number of extracts to make |
1055 | | - * @param int $contextchars length of snippet |
1056 | | - * @param array $out map for highlighted snippets |
1057 | | - * @param array $offsets map of starting points of snippets |
| 1035 | + * @param $pattern String: regexp for matching lines |
| 1036 | + * @param $extracts Array: extracts to search |
| 1037 | + * @param $linesleft Integer: number of extracts to make |
| 1038 | + * @param $contextchars Integer: length of snippet |
| 1039 | + * @param $out Array: map for highlighted snippets |
| 1040 | + * @param $offsets Array: map of starting points of snippets |
1058 | 1041 | * @protected |
1059 | 1042 | */ |
1060 | 1043 | function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ){ |
— | — | @@ -1120,7 +1103,7 @@ |
1121 | 1104 | * callback to replace [[target|caption]] kind of links, if |
1122 | 1105 | * the target is category or image, leave it |
1123 | 1106 | * |
1124 | | - * @param array $matches |
| 1107 | + * @param $matches Array |
1125 | 1108 | */ |
1126 | 1109 | function linkReplace($matches){ |
1127 | 1110 | $colon = strpos( $matches[1], ':' ); |
— | — | @@ -1140,11 +1123,11 @@ |
1141 | 1124 | * Simple & fast snippet extraction, but gives completely unrelevant |
1142 | 1125 | * snippets |
1143 | 1126 | * |
1144 | | - * @param string $text |
1145 | | - * @param array $terms |
1146 | | - * @param int $contextlines |
1147 | | - * @param int $contextchars |
1148 | | - * @return string |
| 1127 | + * @param $text String |
| 1128 | + * @param $terms Array |
| 1129 | + * @param $contextlines Integer |
| 1130 | + * @param $contextchars Integer |
| 1131 | + * @return String |
1149 | 1132 | */ |
1150 | 1133 | public function highlightSimple( $text, $terms, $contextlines, $contextchars ) { |
1151 | 1134 | global $wgLang, $wgContLang; |
— | — | @@ -1196,7 +1179,7 @@ |
1197 | 1180 | |
1198 | 1181 | /** |
1199 | 1182 | * Dummy class to be used when non-supported Database engine is present. |
1200 | | - * @fixme Dummy class should probably try something at least mildly useful, |
| 1183 | + * @todo Fixme: dummy class should probably try something at least mildly useful, |
1201 | 1184 | * such as a LIKE search through titles. |
1202 | 1185 | * @ingroup Search |
1203 | 1186 | */ |
Index: trunk/phase3/includes/SearchPostgres.php |
— | — | @@ -37,9 +37,8 @@ |
38 | 38 | * Currently searches a page's current title (page.page_title) and |
39 | 39 | * latest revision article text (pagecontent.old_text) |
40 | 40 | * |
41 | | - * @param string $term - Raw search term |
| 41 | + * @param $term String: raw search term |
42 | 42 | * @return PostgresSearchResultSet |
43 | | - * @access public |
44 | 43 | */ |
45 | 44 | function searchTitle( $term ) { |
46 | 45 | $q = $this->searchQuery( $term , 'titlevector', 'page_title' ); |
— | — | @@ -130,9 +129,8 @@ |
131 | 130 | |
132 | 131 | /** |
133 | 132 | * Construct the full SQL query to do the search. |
134 | | - * @param string $filteredTerm |
135 | | - * @param string $fulltext |
136 | | - * @private |
| 133 | + * @param $filteredTerm String |
| 134 | + * @param $fulltext String |
137 | 135 | */ |
138 | 136 | function searchQuery( $term, $fulltext, $colname ) { |
139 | 137 | global $wgDBversion; |
Index: trunk/phase3/includes/SearchOracle.php |
— | — | @@ -34,9 +34,8 @@ |
35 | 35 | /** |
36 | 36 | * Perform a full text search query and return a result set. |
37 | 37 | * |
38 | | - * @param string $term - Raw search term |
| 38 | + * @param $term String: raw search term |
39 | 39 | * @return OracleSearchResultSet |
40 | | - * @access public |
41 | 40 | */ |
42 | 41 | function searchText( $term ) { |
43 | 42 | $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), true))); |
— | — | @@ -46,9 +45,8 @@ |
47 | 46 | /** |
48 | 47 | * Perform a title-only search query and return a result set. |
49 | 48 | * |
50 | | - * @param string $term - Raw search term |
| 49 | + * @param $term String: raw search term |
51 | 50 | * @return ORacleSearchResultSet |
52 | | - * @access public |
53 | 51 | */ |
54 | 52 | function searchTitle($term) { |
55 | 53 | $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), false))); |
— | — | @@ -58,8 +56,7 @@ |
59 | 57 | |
60 | 58 | /** |
61 | 59 | * Return a partial WHERE clause to exclude redirects, if so set |
62 | | - * @return string |
63 | | - * @private |
| 60 | + * @return String |
64 | 61 | */ |
65 | 62 | function queryRedirect() { |
66 | 63 | if ($this->showRedirects) { |
— | — | @@ -71,8 +68,7 @@ |
72 | 69 | |
73 | 70 | /** |
74 | 71 | * Return a partial WHERE clause to limit the search to the given namespaces |
75 | | - * @return string |
76 | | - * @private |
| 72 | + * @return String |
77 | 73 | */ |
78 | 74 | function queryNamespaces() { |
79 | 75 | if( is_null($this->namespaces) ) |
— | — | @@ -87,8 +83,7 @@ |
88 | 84 | |
89 | 85 | /** |
90 | 86 | * Return a LIMIT clause to limit results on the query. |
91 | | - * @return string |
92 | | - * @private |
| 87 | + * @return String |
93 | 88 | */ |
94 | 89 | function queryLimit($sql) { |
95 | 90 | return $this->db->limitResult($sql, $this->limit, $this->offset); |
— | — | @@ -97,8 +92,7 @@ |
98 | 93 | /** |
99 | 94 | * Does not do anything for generic search engine |
100 | 95 | * subclasses may define this though |
101 | | - * @return string |
102 | | - * @private |
| 96 | + * @return String |
103 | 97 | */ |
104 | 98 | function queryRanking($filteredTerm, $fulltext) { |
105 | 99 | return ' ORDER BY score(1)'; |
— | — | @@ -107,9 +101,8 @@ |
108 | 102 | /** |
109 | 103 | * Construct the full SQL query to do the search. |
110 | 104 | * The guts shoulds be constructed in queryMain() |
111 | | - * @param string $filteredTerm |
112 | | - * @param bool $fulltext |
113 | | - * @private |
| 105 | + * @param $filteredTerm String |
| 106 | + * @param $fulltext Boolean |
114 | 107 | */ |
115 | 108 | function getQuery( $filteredTerm, $fulltext ) { |
116 | 109 | return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' . |
— | — | @@ -121,8 +114,8 @@ |
122 | 115 | |
123 | 116 | /** |
124 | 117 | * Picks which field to index on, depending on what type of query. |
125 | | - * @param bool $fulltext |
126 | | - * @return string |
| 118 | + * @param $fulltext Boolean |
| 119 | + * @return String |
127 | 120 | */ |
128 | 121 | function getIndexField($fulltext) { |
129 | 122 | return $fulltext ? 'si_text' : 'si_title'; |
— | — | @@ -131,10 +124,9 @@ |
132 | 125 | /** |
133 | 126 | * Get the base part of the search query. |
134 | 127 | * |
135 | | - * @param string $filteredTerm |
136 | | - * @param bool $fulltext |
137 | | - * @return string |
138 | | - * @private |
| 128 | + * @param $filteredTerm String |
| 129 | + * @param $fulltext Boolean |
| 130 | + * @return String |
139 | 131 | */ |
140 | 132 | function queryMain( $filteredTerm, $fulltext ) { |
141 | 133 | $match = $this->parseQuery($filteredTerm, $fulltext); |
— | — | @@ -183,9 +175,9 @@ |
184 | 176 | * Create or update the search index record for the given page. |
185 | 177 | * Title and text should be pre-processed. |
186 | 178 | * |
187 | | - * @param int $id |
188 | | - * @param string $title |
189 | | - * @param string $text |
| 179 | + * @param $id Integer |
| 180 | + * @param $title String |
| 181 | + * @param $text String |
190 | 182 | */ |
191 | 183 | function update($id, $title, $text) { |
192 | 184 | $dbw = wfGetDB(DB_MASTER); |
Index: trunk/phase3/includes/SearchIBM_DB2.php |
— | — | @@ -34,9 +34,8 @@ |
35 | 35 | /** |
36 | 36 | * Perform a full text search query and return a result set. |
37 | 37 | * |
38 | | - * @param string $term - Raw search term |
| 38 | + * @param $term String: raw search term |
39 | 39 | * @return IBM_DB2SearchResultSet |
40 | | - * @access public |
41 | 40 | */ |
42 | 41 | function searchText( $term ) { |
43 | 42 | $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), true))); |
— | — | @@ -46,9 +45,8 @@ |
47 | 46 | /** |
48 | 47 | * Perform a title-only search query and return a result set. |
49 | 48 | * |
50 | | - * @param string $term - Raw search term |
| 49 | + * @param $term String: taw search term |
51 | 50 | * @return IBM_DB2SearchResultSet |
52 | | - * @access public |
53 | 51 | */ |
54 | 52 | function searchTitle($term) { |
55 | 53 | $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), false))); |
— | — | @@ -58,8 +56,7 @@ |
59 | 57 | |
60 | 58 | /** |
61 | 59 | * Return a partial WHERE clause to exclude redirects, if so set |
62 | | - * @return string |
63 | | - * @private |
| 60 | + * @return String |
64 | 61 | */ |
65 | 62 | function queryRedirect() { |
66 | 63 | if ($this->showRedirects) { |
— | — | @@ -71,8 +68,7 @@ |
72 | 69 | |
73 | 70 | /** |
74 | 71 | * Return a partial WHERE clause to limit the search to the given namespaces |
75 | | - * @return string |
76 | | - * @private |
| 72 | + * @return String |
77 | 73 | */ |
78 | 74 | function queryNamespaces() { |
79 | 75 | if( is_null($this->namespaces) ) |
— | — | @@ -86,8 +82,7 @@ |
87 | 83 | |
88 | 84 | /** |
89 | 85 | * Return a LIMIT clause to limit results on the query. |
90 | | - * @return string |
91 | | - * @private |
| 86 | + * @return String |
92 | 87 | */ |
93 | 88 | function queryLimit($sql) { |
94 | 89 | return $this->db->limitResult($sql, $this->limit, $this->offset); |
— | — | @@ -96,8 +91,7 @@ |
97 | 92 | /** |
98 | 93 | * Does not do anything for generic search engine |
99 | 94 | * subclasses may define this though |
100 | | - * @return string |
101 | | - * @private |
| 95 | + * @return String |
102 | 96 | */ |
103 | 97 | function queryRanking($filteredTerm, $fulltext) { |
104 | 98 | // requires Net Search Extender or equivalent |
— | — | @@ -108,9 +102,8 @@ |
109 | 103 | /** |
110 | 104 | * Construct the full SQL query to do the search. |
111 | 105 | * The guts shoulds be constructed in queryMain() |
112 | | - * @param string $filteredTerm |
113 | | - * @param bool $fulltext |
114 | | - * @private |
| 106 | + * @param string $filteredTerm String |
| 107 | + * @param bool $fulltext Boolean |
115 | 108 | */ |
116 | 109 | function getQuery( $filteredTerm, $fulltext ) { |
117 | 110 | return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' . |
— | — | @@ -122,8 +115,8 @@ |
123 | 116 | |
124 | 117 | /** |
125 | 118 | * Picks which field to index on, depending on what type of query. |
126 | | - * @param bool $fulltext |
127 | | - * @return string |
| 119 | + * @param $fulltext Boolean |
| 120 | + * @return String |
128 | 121 | */ |
129 | 122 | function getIndexField($fulltext) { |
130 | 123 | return $fulltext ? 'si_text' : 'si_title'; |
— | — | @@ -132,10 +125,9 @@ |
133 | 126 | /** |
134 | 127 | * Get the base part of the search query. |
135 | 128 | * |
136 | | - * @param string $filteredTerm |
137 | | - * @param bool $fulltext |
138 | | - * @return string |
139 | | - * @private |
| 129 | + * @param string $filteredTerm String |
| 130 | + * @param bool $fulltext Boolean |
| 131 | + * @return String |
140 | 132 | */ |
141 | 133 | function queryMain( $filteredTerm, $fulltext ) { |
142 | 134 | $match = $this->parseQuery($filteredTerm, $fulltext); |
— | — | @@ -185,9 +177,9 @@ |
186 | 178 | * Create or update the search index record for the given page. |
187 | 179 | * Title and text should be pre-processed. |
188 | 180 | * |
189 | | - * @param int $id |
190 | | - * @param string $title |
191 | | - * @param string $text |
| 181 | + * @param $id Integer |
| 182 | + * @param $title String |
| 183 | + * @param $text String |
192 | 184 | */ |
193 | 185 | function update($id, $title, $text) { |
194 | 186 | $dbw = wfGetDB(DB_MASTER); |
— | — | @@ -207,8 +199,8 @@ |
208 | 200 | * Update a search index record's title only. |
209 | 201 | * Title should be pre-processed. |
210 | 202 | * |
211 | | - * @param int $id |
212 | | - * @param string $title |
| 203 | + * @param $id Integer |
| 204 | + * @param $title String |
213 | 205 | */ |
214 | 206 | function updateTitle($id, $title) { |
215 | 207 | $dbw = wfGetDB(DB_MASTER); |
Index: trunk/phase3/includes/SearchMySQL.php |
— | — | @@ -86,9 +86,8 @@ |
87 | 87 | /** |
88 | 88 | * Perform a full text search query and return a result set. |
89 | 89 | * |
90 | | - * @param string $term - Raw search term |
| 90 | + * @param $term String: raw search term |
91 | 91 | * @return MySQLSearchResultSet |
92 | | - * @access public |
93 | 92 | */ |
94 | 93 | function searchText( $term ) { |
95 | 94 | $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), true ) ) ); |
— | — | @@ -98,9 +97,8 @@ |
99 | 98 | /** |
100 | 99 | * Perform a title-only search query and return a result set. |
101 | 100 | * |
102 | | - * @param string $term - Raw search term |
| 101 | + * @param $term String: raw search term |
103 | 102 | * @return MySQLSearchResultSet |
104 | | - * @access public |
105 | 103 | */ |
106 | 104 | function searchTitle( $term ) { |
107 | 105 | $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) ); |
— | — | @@ -110,8 +108,7 @@ |
111 | 109 | |
112 | 110 | /** |
113 | 111 | * Return a partial WHERE clause to exclude redirects, if so set |
114 | | - * @return string |
115 | | - * @private |
| 112 | + * @return String |
116 | 113 | */ |
117 | 114 | function queryRedirect() { |
118 | 115 | if( $this->showRedirects ) { |
— | — | @@ -123,8 +120,7 @@ |
124 | 121 | |
125 | 122 | /** |
126 | 123 | * Return a partial WHERE clause to limit the search to the given namespaces |
127 | | - * @return string |
128 | | - * @private |
| 124 | + * @return String |
129 | 125 | */ |
130 | 126 | function queryNamespaces() { |
131 | 127 | if( is_null($this->namespaces) ) |
— | — | @@ -139,8 +135,7 @@ |
140 | 136 | |
141 | 137 | /** |
142 | 138 | * Return a LIMIT clause to limit results on the query. |
143 | | - * @return string |
144 | | - * @private |
| 139 | + * @return String |
145 | 140 | */ |
146 | 141 | function queryLimit() { |
147 | 142 | return $this->db->limitResult( '', $this->limit, $this->offset ); |
— | — | @@ -149,8 +144,7 @@ |
150 | 145 | /** |
151 | 146 | * Does not do anything for generic search engine |
152 | 147 | * subclasses may define this though |
153 | | - * @return string |
154 | | - * @private |
| 148 | + * @return String |
155 | 149 | */ |
156 | 150 | function queryRanking( $filteredTerm, $fulltext ) { |
157 | 151 | return ''; |
— | — | @@ -159,9 +153,8 @@ |
160 | 154 | /** |
161 | 155 | * Construct the full SQL query to do the search. |
162 | 156 | * The guts shoulds be constructed in queryMain() |
163 | | - * @param string $filteredTerm |
164 | | - * @param bool $fulltext |
165 | | - * @private |
| 157 | + * @param $filteredTerm String |
| 158 | + * @param $fulltext Boolean |
166 | 159 | */ |
167 | 160 | function getQuery( $filteredTerm, $fulltext ) { |
168 | 161 | return $this->queryMain( $filteredTerm, $fulltext ) . ' ' . |
— | — | @@ -174,8 +167,8 @@ |
175 | 168 | |
176 | 169 | /** |
177 | 170 | * Picks which field to index on, depending on what type of query. |
178 | | - * @param bool $fulltext |
179 | | - * @return string |
| 171 | + * @param $fulltext Boolean |
| 172 | + * @return String |
180 | 173 | */ |
181 | 174 | function getIndexField( $fulltext ) { |
182 | 175 | return $fulltext ? 'si_text' : 'si_title'; |
— | — | @@ -187,10 +180,9 @@ |
188 | 181 | * version; MySQL 3 and MySQL 4 have different capabilities |
189 | 182 | * in their fulltext search indexes. |
190 | 183 | * |
191 | | - * @param string $filteredTerm |
192 | | - * @param bool $fulltext |
193 | | - * @return string |
194 | | - * @private |
| 184 | + * @param $filteredTerm String |
| 185 | + * @param $fulltext Boolean |
| 186 | + * @return String |
195 | 187 | */ |
196 | 188 | function queryMain( $filteredTerm, $fulltext ) { |
197 | 189 | $match = $this->parseQuery( $filteredTerm, $fulltext ); |
— | — | @@ -205,9 +197,9 @@ |
206 | 198 | * Create or update the search index record for the given page. |
207 | 199 | * Title and text should be pre-processed. |
208 | 200 | * |
209 | | - * @param int $id |
210 | | - * @param string $title |
211 | | - * @param string $text |
| 201 | + * @param $id Integer |
| 202 | + * @param $title String |
| 203 | + * @param $text String |
212 | 204 | */ |
213 | 205 | function update( $id, $title, $text ) { |
214 | 206 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -224,8 +216,8 @@ |
225 | 217 | * Update a search index record's title only. |
226 | 218 | * Title should be pre-processed. |
227 | 219 | * |
228 | | - * @param int $id |
229 | | - * @param string $title |
| 220 | + * @param $id Integer |
| 221 | + * @param $title String |
230 | 222 | */ |
231 | 223 | function updateTitle( $id, $title ) { |
232 | 224 | $dbw = wfGetDB( DB_MASTER ); |