Index: trunk/phase3/includes/SearchOracle.php |
— | — | @@ -159,7 +159,17 @@ |
160 | 160 | if (preg_match_all('/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
161 | 161 | $filteredText, $m, PREG_SET_ORDER)) { |
162 | 162 | foreach($m as $terms) { |
163 | | - $q[] = $terms[1] . $wgContLang->stripForSearch($terms[2]); |
| 163 | + |
| 164 | + // Search terms in all variant forms, only |
| 165 | + // apply on wiki with LanguageConverter |
| 166 | + $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] ); |
| 167 | + if( is_array( $temp_terms )) { |
| 168 | + $temp_terms = array_unique( array_values( $temp_terms )); |
| 169 | + foreach( $temp_terms as $t ) |
| 170 | + $q[] = $terms[1] . $wgContLang->stripForSearch( $t ); |
| 171 | + } |
| 172 | + else |
| 173 | + $q[] = $terms[1] . $wgContLang->stripForSearch( $terms[2] ); |
164 | 174 | |
165 | 175 | if (!empty($terms[3])) { |
166 | 176 | $regexp = preg_quote( $terms[3], '/' ); |
Index: trunk/phase3/includes/SearchIBM_DB2.php |
— | — | @@ -151,8 +151,18 @@ |
152 | 152 | if (preg_match_all('/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
153 | 153 | $filteredText, $m, PREG_SET_ORDER)) { |
154 | 154 | foreach($m as $terms) { |
155 | | - $q[] = $terms[1] . $wgContLang->stripForSearch($terms[2]); |
156 | 155 | |
| 156 | + // Search terms in all variant forms, only |
| 157 | + // apply on wiki with LanguageConverter |
| 158 | + $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] ); |
| 159 | + if( is_array( $temp_terms )) { |
| 160 | + $temp_terms = array_unique( array_values( $temp_terms )); |
| 161 | + foreach( $temp_terms as $t ) |
| 162 | + $q[] = $terms[1] . $wgContLang->stripForSearch( $t ); |
| 163 | + } |
| 164 | + else |
| 165 | + $q[] = $terms[1] . $wgContLang->stripForSearch( $terms[2] ); |
| 166 | + |
157 | 167 | if (!empty($terms[3])) { |
158 | 168 | $regexp = preg_quote( $terms[3], '/' ); |
159 | 169 | if ($terms[4]) |
Index: trunk/phase3/includes/SearchMySQL.php |
— | — | @@ -53,7 +53,16 @@ |
54 | 54 | if( $this->strictMatching && ($terms[1] == '') ) { |
55 | 55 | $terms[1] = '+'; |
56 | 56 | } |
57 | | - $searchon .= $terms[1] . $wgContLang->stripForSearch( $terms[2] ); |
| 57 | + // Search terms in all variant forms, only |
| 58 | + // apply on wiki with LanguageConverter |
| 59 | + $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] ); |
| 60 | + if( is_array( $temp_terms )) { |
| 61 | + $temp_terms = array_unique( array_values( $temp_terms )); |
| 62 | + foreach( $temp_terms as $t ) |
| 63 | + $searchon .= $terms[1] . $wgContLang->stripForSearch( $t ) . ' '; |
| 64 | + } |
| 65 | + else |
| 66 | + $searchon .= $terms[1] . $wgContLang->stripForSearch( $terms[2] ); |
58 | 67 | if( !empty( $terms[3] ) ) { |
59 | 68 | // Match individual terms in result highlighting... |
60 | 69 | $regexp = preg_quote( $terms[3], '/' ); |
— | — | @@ -259,4 +268,4 @@ |
260 | 269 | function free() { |
261 | 270 | $this->mResultSet->free(); |
262 | 271 | } |
263 | | -} |
| 272 | +} |
\ No newline at end of file |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -81,6 +81,8 @@ |
82 | 82 | 'recentchangeslinked-toolbox' were added to allow more fine grained |
83 | 83 | customisation of the user interface |
84 | 84 | * DISPLAYTITLE now accepts a limited amount of wiki markup (the single-quote items) |
| 85 | +* Special:Search now could search terms in all variant-forms. ONLY apply on |
| 86 | + wikis with LanguageConverter |
85 | 87 | |
86 | 88 | === Bug fixes in 1.16 === |
87 | 89 | |