A MySQL question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GirishR
Forum Newbie
Posts: 11
Joined: Wed May 19, 2004 6:48 am
Contact:

A MySQL question

Post by GirishR »

Hello all
Is there any way I can use both the 'IN BOOLEAN MODE' and 'AS' score in a mysql query.

Thanks
Girish R
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Example please

Post by Lord Sauron »

Can you give an example please. What are you exactly trying to do?
GirishR
Forum Newbie
Posts: 11
Joined: Wed May 19, 2004 6:48 am
Contact:

Post by GirishR »

This is what i am trying to.
SELECT id, body, MATCH (title,body) AGAINST
('Security implications of running MySQL as root' IN BOOLEAN MODE) AS score
FROM articles WHERE MATCH (title,body) AGAINST
('Security implications of running MySQL as root' IN BOOLEAN MODE);

But the score is always 1. Why is that. Please help me.

Girish R
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Copy it!

Post by Lord Sauron »

I noticed, that you did copy that code from an online tutorial http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html.

Try to read a little better next time. Below this query it says:

Code: Select all

Such a technique works best with large collections (in fact, it was carefully tuned this way). For very small tables, word distribution does not adequately reflect their semantic value, and this model may sometimes produce bizarre results. For example, although the word ``MySQL'' is present in every row of the articles table, a search for the word produces no results
So, the question is: "is your table small?"
Post Reply