Wikka Mod 023

Type: Feature Addition

Credit:

???? - For originally coding the categories action.
Jason Tourtelotte -- for adding FullCategoryTextSearch().


Added function FullCategoryTextSearch to wakka.php because I found out that MySQL was not returning the expected category results.

The search result is empty because the word MySQL is present in at least 50% of the rows. As such, it is effectively treated as a stopword. For large datasets, this is the most desirable behavior--a natural language query should not return every second row from a 1GB table. For small datasets, it may be less desirable.

A word that matches half of rows in a table is less likely to locate relevant documents. In fact, it will most likely find plenty of irrelevant documents. We all know this happens far too often when we are trying to find something on the Internet with a search engine. It is with this reasoning that rows containing the word are assigned a low semantic value for the particular dataset in which they occur. A given word may exceed the 50% threshold in one dataset but not another.

The 50% threshold has a significant implication when you first try full-text searching to see how it works: If you create a table and insert only one or two rows of text into it, every word in the text occurs in at least 50% of the rows. As a result, no searches return any results. Be sure to insert at least three rows, and preferably many more.

    function FullCategoryTextSearch($phrase) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' and match(tag, body) against('".mysql_escape_string($phrase)."' IN BOOLEAN MODE)"); }
Comments
Comment by p508166D9.dip0.t-ipconnect.de
2004-08-13 21:07:34
Why is this function not in the released code?
Comment by JsnX
2004-08-14 01:43:29
It is. Try searching for 'FullCategoryTextSearch' in wikka.php.
Comment by p50816995.dip0.t-ipconnect.de
2004-08-25 19:44:58
I did, and it was different (1.3.8).
Comment by DreckFehler
2004-08-26 21:57:19
what mysql-version are you running? at least the boolean mode has changed since wikka 1.1.3.8 but mysql prior to 4.0 only at times reports an error.

and - of course - it would be helpful to have a more detailed description of your problem. eventually it will bring you closer to a quick fix.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki