i recently upgrading to mysql 4.0 and have taken advantage of boolean searches. however, i ran into a problem. for example on google if somebody types for a query "the dog ran" it is the same as "+the +dog +ran". with the new mysql boolean search, it is not.
what i think i need is for the search query to automatically append a (+) plus sign in front of any word that does not have a (") quote, (-) minus sign, or an exisiting (+) plus sign.
Hopefully this makes some sense. I have NO CLUE how to do it.
Lets say a user types in "Vice city cheats" in the search. No symbols listed above are present so it goes into the query as "+vice +city +cheats". Or, if a user types "-Vice city +cheats" it will add a (+) sign JUST to city because there are no symbols listed above to it.
Does this make sense? Below is an example of the code I have now which is nothing near right I'm guessing:
[code=php]
$plusWords = preg_match_all("/+{1}s{0,}w+s*/",$querySearch);
echo "PLUS: $plusWords<P>";
echo "you searched for <B>$querySearch</B> in <B>$findWhat</B><P>";
echo "<table>";
while ($row = mysql_fetch_array ($result)) {
extract($row);
echo "<tr><td>$gametitle</td><td>$gameid</td></tr>\n";
[/code]
I know that plusWords line is nothing near right. I was just messing around, maybe it will give you an idea. Thanks in advance for anyhelp. Trying to get this engine up and working today.