Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -142,10 +142,16 @@ |
143 | 143 | |
144 | 144 | div.searchdidyoumean { |
145 | 145 | font-size: 127%; |
146 | | - padding-bottom:1ex; |
147 | | - padding-top:1ex; |
| 146 | + margin-bottom: 1ex; |
| 147 | + margin-top: 1ex; |
| 148 | + /* Note that this color won't affect the link, as desired. */ |
| 149 | + color: #c00; |
148 | 150 | } |
149 | 151 | |
| 152 | +div.searchdidyoumean em { |
| 153 | + font-weight: bold; |
| 154 | +} |
| 155 | + |
150 | 156 | .searchmatch { |
151 | 157 | font-weight: bold; |
152 | 158 | } |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -930,6 +930,24 @@ |
931 | 931 | |
932 | 932 | $this->setupPage( $term ); |
933 | 933 | |
| 934 | + $rewritten = $search->replacePrefixes($term); |
| 935 | + $titleMatches = $search->searchTitle( $rewritten ); |
| 936 | + $textMatches = $search->searchText( $rewritten ); |
| 937 | + |
| 938 | + // did you mean... suggestions |
| 939 | + if($textMatches && $textMatches->hasSuggestion()){ |
| 940 | + $st = SpecialPage::getTitleFor( 'Search' ); |
| 941 | + $stParams = wfArrayToCGI( array( |
| 942 | + 'search' => $textMatches->getSuggestionQuery(), |
| 943 | + 'fulltext' => wfMsg('search')), |
| 944 | + $this->powerSearchOptions()); |
| 945 | + |
| 946 | + $suggestLink = '<a href="'.$st->escapeLocalURL($stParams).'">'. |
| 947 | + $textMatches->getSuggestionSnippet().'</a>'; |
| 948 | + |
| 949 | + $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>'); |
| 950 | + } |
| 951 | + |
934 | 952 | $wgOut->addWikiMsg( 'searchresulttext' ); |
935 | 953 | |
936 | 954 | if( '' === trim( $term ) ) { |
— | — | @@ -967,10 +985,7 @@ |
968 | 986 | } |
969 | 987 | |
970 | 988 | $wgOut->addHTML( $this->shortDialog( $term ) ); |
971 | | - $rewritten = $search->replacePrefixes($term); |
972 | 989 | |
973 | | - $titleMatches = $search->searchTitle( $rewritten ); |
974 | | - |
975 | 990 | // Sometimes the search engine knows there are too many hits |
976 | 991 | if ($titleMatches instanceof SearchResultTooMany) { |
977 | 992 | $wgOut->addWikiText( '==' . wfMsg( 'toomanymatches' ) . "==\n" ); |
— | — | @@ -980,22 +995,6 @@ |
981 | 996 | return; |
982 | 997 | } |
983 | 998 | |
984 | | - $textMatches = $search->searchText( $rewritten ); |
985 | | - |
986 | | - // did you mean... suggestions |
987 | | - if($textMatches && $textMatches->hasSuggestion()){ |
988 | | - $st = SpecialPage::getTitleFor( 'Search' ); |
989 | | - $stParams = wfArrayToCGI( array( |
990 | | - 'search' => $textMatches->getSuggestionQuery(), |
991 | | - 'fulltext' => wfMsg('search')), |
992 | | - $this->powerSearchOptions()); |
993 | | - |
994 | | - $suggestLink = '<a href="'.$st->escapeLocalURL($stParams).'">'. |
995 | | - $textMatches->getSuggestionSnippet().'</a>'; |
996 | | - |
997 | | - $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>'); |
998 | | - } |
999 | | - |
1000 | 999 | // show number of results |
1001 | 1000 | $num = ( $titleMatches ? $titleMatches->numRows() : 0 ) |
1002 | 1001 | + ( $textMatches ? $textMatches->numRows() : 0); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -256,6 +256,7 @@ |
257 | 257 | * (bug 16121) Add a note that a page move was without creating a redirect in the |
258 | 258 | move log |
259 | 259 | * Image moving is now enabled for sysops by default |
| 260 | +* Make "Did you mean" search feature more noticeable |
260 | 261 | |
261 | 262 | === Bug fixes in 1.14 === |
262 | 263 | |
Index: trunk/extensions/MWSearch/MWSearch_body.php |
— | — | @@ -599,7 +599,7 @@ |
600 | 600 | $suggestText = ""; |
601 | 601 | for($i=1;$i<count($points);$i+=2){ |
602 | 602 | $suggestText .= substr($sug,$points[$i-1],$points[$i]-$points[$i-1]); |
603 | | - $suggestText .= "<i>".substr($sug,$points[$i],$points[$i+1]-$points[$i])."</i>"; |
| 603 | + $suggestText .= '<em>'.substr($sug,$points[$i],$points[$i+1]-$points[$i])."</em>"; |
604 | 604 | } |
605 | 605 | $suggestText .= substr($sug,end($points)); |
606 | 606 | |