Full-text searches sucks?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey all,
I just put in a search function for a site using mySql full text, i am
running it on my local server for now.
I am running it on two fields: ad_sub and ad_text

The results i getting are really quite bad, this is how i am testing it out:

1. I wrote an insert statement and looped it 700 times, so i have 700 test
records in the db which are identical
2. I found two words which are in the ad_text of the insert statement and
wrote a search statement like so:

SELECT *,
                MATCH(ad_sub, ad_text) AGAINST('want to') AS score
                FROM blk_ads
            WHERE MATCH(ad_sub, ad_text) AGAINST('want to')
            ORDER BY score DESC LIMIT 0,40;

2a. I have checked many times and this text " want to use a full....." is
present in the ad_text field

but mysql gives me no results.


Reading up on "full-text " I came accross this useful piece of info:
 you should add at least 3 rows to the table before you try to match
anything, and what you're searching for should only be contained in one of
the three rows. This is because of the 50% threshold. If you insert only one
row, then now matter what you search for, it is in 50% or more of the rows
in the table, and therefore disregarded

which means because I i getting a match for well over 50% of the
records...its disregarding it.

Now i am in two minds if i should use this or go back to the same old dirty
way...of exploding the search and using LIKE '%%' for each word

Comments/suggestions?

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux