Fulltext boolean question

2005-03-25 Thread Ed Lazor
Hi,

How can I limit the results of a fulltext search to the entries that only
have the keywords I'm searching for?

I'm searching the title field of a product database and I only want results
if the title has all of the words specified.  I tried putting the word AND
between each word and mysql responds with products even when the title only
has one of the key words.

Here's an example query:

select *, ( match(title) against ('dragon and ice and blue' IN BOOLEAN MODE)
) as score from products where ( match(title) against ('dragon and ice and
blue' IN BOOLEAN MODE) ) order by score DESC

This query returns products with titles like Land of Fire and Ice.  Since
that product title doesn't have the word dragon in it, I don't understand
why it's even showing up in the results set (and I'd like it to stop if
that's possible).

Thank,

Ed


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Fulltext boolean question

2005-03-25 Thread Chris
Try using:
+dragon +ice +blue
I'm fairly sure that's in the FULLTEXT search portion of the online docs.
Chris
Ed Lazor wrote:
Hi,
How can I limit the results of a fulltext search to the entries that only
have the keywords I'm searching for?
I'm searching the title field of a product database and I only want results
if the title has all of the words specified.  I tried putting the word AND
between each word and mysql responds with products even when the title only
has one of the key words.
Here's an example query:
select *, ( match(title) against ('dragon and ice and blue' IN BOOLEAN MODE)
) as score from products where ( match(title) against ('dragon and ice and
blue' IN BOOLEAN MODE) ) order by score DESC
This query returns products with titles like Land of Fire and Ice.  Since
that product title doesn't have the word dragon in it, I don't understand
why it's even showing up in the results set (and I'd like it to stop if
that's possible).
Thank,
Ed
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Fulltext boolean question

2005-03-25 Thread Ed Lazor
Oh hey, very cool - thanks.  I was assuming that + and AND were the same
thing, guess not =)

-Ed


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 25, 2005 4:21 PM
To: mysql@lists.mysql.com
Subject: Re: Fulltext boolean question

Try using:

+dragon +ice +blue

I'm fairly sure that's in the FULLTEXT search portion of the 
online docs.

Chris

Ed Lazor wrote:

Hi,

How can I limit the results of a fulltext search to the 
entries that only
have the keywords I'm searching for?

I'm searching the title field of a product database and I only 
want results
if the title has all of the words specified.  I tried putting 
the word AND
between each word and mysql responds with products even when 
the title only
has one of the key words.

Here's an example query:

select *, ( match(title) against ('dragon and ice and blue' IN 
BOOLEAN MODE)
) as score from products where ( match(title) against ('dragon 
and ice and
blue' IN BOOLEAN MODE) ) order by score DESC

This query returns products with titles like Land of Fire and 
Ice.  Since
that product title doesn't have the word dragon in it, I 
don't understand
why it's even showing up in the results set (and I'd like it to stop if
that's possible).

Thank,

Ed


  



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]