assela Pathirana:Mediawiki Wildcard Searching

From assela Pathirana
Jump to navigationJump to search
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

LNK

See Also

Boolean Fulltext Searches chapter of MySQL manual.