tags:

views:

20

answers:

1

Hi, I have written query of search program by MATCH(...) AGAINST(...) mysql query. But i m not getting perfect result. I want maximum keyword search result should be in top and so on. Like if am searching "part time jobs in India". And suppose i have some records of title like

1)"get part time jobs in India"

2)part time jobs

3)jobs

Than my result should also filter like above. Means maximum searches keywords should be in top.

What type of query i should written in my mysql.Presently i have written fulltext search query and my field is also indexed.

A: 

Do it like this:

SELECT *, MATCH(columnname) AGAINST('keyword') AS score
FROM tablename 
WHERE MATCH(columnname) AGAINST('keyword') 
ORDER BY score DESC LIMTI 5

Reference: http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html

shamittomar
thanks.. it seems to solved i have to check more.
Ajay_kumar
If this solved it, please accept the answer.
shamittomar