I use the PHP search engine at http://www.designplace.org/ It works 100% exept for that it's not fulltext, and the results come out not the way I want so i want it to be FULLTEXT, my DB is set to be FULLTEXT and everything, I've read through every sites and throught the mysql tutorial for FULLTEXT, but i cannot get this to work, maybe its the way the script is setup or something
PLLEASEE help me!!!
thanks!!!!!!!!!!!!!
FULLTEXT search engine...need help??
Moderator: General Moderators
First thing I noticed is that the script uses GET as the form method - POST is much better.
You mentioned a mysql FULLTEXT tutorial: do you mean the mysql manual? See mysql.com if you don't have it - downloadable version is worth getting. There's really not much I could add to the manual notes. Have you got mysql 3.23.23 or higher? (previous versions don't support FULLTEXT searches).
Post your mysql query string if you're still stuck.
One other point: mysql 4.01 added support for the BOOLEAN option with FULLTEXT searches. In my opinion, MATCH is pretty useless without it.
A non-boolean MATCH search cannot do a whole phrase search: it will (afaik) rank results depending on the frequency of the individual words in the phrase regardless of whether they actually occur as a phrase or not (and also seems to rank the results depending on how many other words there are to "dilute" the search terms).
However, to my mind, a site search script isn't much use if you can't do a meaningful whole phrase search so if you don't have mysql 4.01 or higher I'd recommend you don't use FULLTEXT searches.
Of course site search scripts aren't much use without ranking either - could get around that with a bit of substr_count in the script.
Experiment yourself though, and see what you think.
You mentioned a mysql FULLTEXT tutorial: do you mean the mysql manual? See mysql.com if you don't have it - downloadable version is worth getting. There's really not much I could add to the manual notes. Have you got mysql 3.23.23 or higher? (previous versions don't support FULLTEXT searches).
Post your mysql query string if you're still stuck.
One other point: mysql 4.01 added support for the BOOLEAN option with FULLTEXT searches. In my opinion, MATCH is pretty useless without it.
A non-boolean MATCH search cannot do a whole phrase search: it will (afaik) rank results depending on the frequency of the individual words in the phrase regardless of whether they actually occur as a phrase or not (and also seems to rank the results depending on how many other words there are to "dilute" the search terms).
However, to my mind, a site search script isn't much use if you can't do a meaningful whole phrase search so if you don't have mysql 4.01 or higher I'd recommend you don't use FULLTEXT searches.
Of course site search scripts aren't much use without ranking either - could get around that with a bit of substr_count in the script.
Experiment yourself though, and see what you think.
hmm thanks for saying that
i got mysql 3.23.47
i really need fulltext cause my database has stuff like for 'example'
apple.juice
or
apple_juice
when somone searches for apple juicenone of those matches come up
can you give me an example of the best query string to use for fulltext
i have 1 table and 3 fields id url and contains
the search,searches the contains field
(my site is a huge db of websites)
i got mysql 3.23.47
i really need fulltext cause my database has stuff like for 'example'
apple.juice
or
apple_juice
when somone searches for apple juicenone of those matches come up
can you give me an example of the best query string to use for fulltext
i have 1 table and 3 fields id url and contains
the search,searches the contains field
(my site is a huge db of websites)
I don't know what FULLTEXT indexes you have defined but here's a sample which might help:
Column3 is the column you are searching in: this must have a FULLTEXT index. Cols 1 & 2 are the columns returned in the result array - along with "score" (you can display the relevance alongside the search results by echo'ing out $result['score'] in the while loop).
Code: Select all
<?php
$mysql = "SELECT column1,column2, MATCH (column3) AGAINST ('search text') AS score FROM table WHERE MATCH (column3) AGAINST ('search text')";
$query = mysql_query($mysql) or die("Cannot query the database.<br>" . mysql_error());
echo mysql_num_rows($query);
echo '<hr>';
while ($result = mysql_fetch_assoc($query)) {
print_r($result);
echo '<hr>';
}
?>
Last edited by McGruff on Thu Aug 11, 2005 9:22 am, edited 1 time in total.