Revision [141]

This is an old revision of Mod029fImprovedSearch made by JsnX on 2004-04-09 01:12:27.


Wikka Mod 029

Type: Feature Addition


pmyatt -- for the original idea and function code.

Use MySQL "UNION" to search for text in TAG as well as the full text search that often returns no results.

This will search for partial matches in page titles (tags). This is of great benefit because the regular search would not find a search for the word "camel" even if you had a page named "CamelCase". This modified search will now find that page.

Here is the function I added in wakka.php:
function FullTextSearchAndLikeTags($phrase) { return $this->LoadAll(" (select * from ".$this->config["table_prefix"]."pages where latest = 'Y' and tag like('%".mysql_escape_string($phrase)."%')) UNION (select * from ".$this->config["table_prefix"]."pages where latest = 'Y' and match(tag, body) against('".mysql_escape_string($phrase)."'))"); } 

Then I modified actions/textsearch.php and actions/textsearchexpanded.php to use the new function.
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki