Difference between revisions of "assela Pathirana:Mediawiki Wildcard Searching"
From assela Pathirana
Jump to navigationJump to search
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
;Note: This article is outdated. Please refer to a much more elegant and safer way of doing this [[Mediawiki Wildcard Searching II|here]]. | |||
[[Mediawiki]] does not allow wildcard searches like cat* to match cats. | [[Mediawiki]] does not allow wildcard searches like cat* to match cats. | ||
Line 6: | Line 7: | ||
function legalSearchChars() { | function legalSearchChars() { | ||
# | #return "A-Za-z_'0-9\\x80-\\xFF\\-"; | ||
return "A-Za-z_'0-9\\x80-\\xFF\\-+*"; | return "A-Za-z_'0-9\\x80-\\xFF\\-+*"; | ||
} | } |
Latest revision as of 05:43, 22 March 2006
- Note
- This article is outdated. Please refer to a much more elegant and safer way of doing this here.
Mediawiki does not allow wildcard searches like cat* to match cats.
The following modifications can enable those
- In File SearchEngine.php
function legalSearchChars() { #return "A-Za-z_'0-9\\x80-\\xFF\\-"; return "A-Za-z_'0-9\\x80-\\xFF\\-+*"; } # + and * are added to the return string.
- In File SearchMySQL4.php
# if( $this->strictMatching && ($terms[1] == ) ) { # $terms[1] = '+'; #} # Comment out the above three lines.
- Source
- See Also
Boolean Fulltext Searches chapter of MySQL manual.