Forum Moderators: coopster

Message Too Old, No Replies

mySQL Match Search Query For Web 2.0 Not Returning Results

Size restriction on search terms?

         

geckofuel

3:28 pm on Apr 23, 2007 (gmt 0)

10+ Year Member



Is there something about this search value (shortness of its members?) that brings a SQL Match search to ignore the results?

$searchvalue="web 2.0";

$query = "select * from table where match (column) against ('$searchvalue')";

$result=mysql_query ($query) or die ('Could not search.' . mysql_error());

$num_rows = mysql_num_rows($result);

When run for this specific query, $num_rows returns zero. For all other queries with expected results, it returns the proper number.

Other search values work just fine, and yes, "web 2.0" occurs exactly as is in the database under "column" in several rows.

eelixduppy

6:48 pm on Apr 23, 2007 (gmt 0)



Your query seems to be just fine. Have you tried running this query directly from the command line or phpmyadmin? If so, does it produce any different results? If you aren't getting any errors, then it is probably because the search string doesn't match anything in the table. If you do figure this out, I'm interested to hear what the problem was.

Good luck! :)

justageek

7:21 pm on Apr 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are running a fulltext index out of the box it will not work and depending on what version you are using the period(.) may or may not cause problems.

You also have words that are not the default 4 letters long such as 'web'.

Make sure you're using 5.0.3 and above and also make sure the min length for words is set to 3...or whatever value you want.

JAG