Is the plus query return more then 50% of the records? If so, MySQL won't return anything since the result set isn't that relevant.

Brent Baisley
Systems Architect


On Apr 11, 2008, at 8:08 AM, Barry wrote:

I am confused ( nothing new there), what I thought was a simple search is proving not to be so,

Can anyone tell me why this query for the word 'plus':
mysql> SELECT *
-> FROM booktitles
-> WHERE MATCH (category , publisher , bookTitle , author)
-> AGAINST (CONVERT( _utf8'plus'USING latin1 )
-> IN BOOLEAN MODE)
-> ORDER BY category;
Empty set (0.00 sec)

returns an empty result set, when this query:

mysql> SELECT *
-> FROM `booklist`.`booktitles`
-> WHERE `id` LIKE '%plus%'
-> OR `category` LIKE CONVERT( _utf8 '%plus%'
-> USING latin1 )
-> COLLATE latin1_swedish_ci
-> OR `publisher` LIKE CONVERT( _utf8 '%plus%'
-> USING latin1 )
-> COLLATE latin1_swedish_ci
-> OR `bookTitle` LIKE CONVERT( _utf8 '%plus%'
-> USING latin1 )
-> COLLATE latin1_swedish_ci
-> OR `author` LIKE CONVERT( _utf8 '%plus%'
-> USING latin1 )
-> COLLATE latin1_swedish_ci
-> OR `publishDate` LIKE '%plus%';
+-----+----------+--------------- + ---------------------------------------------------------------------------+ -------------------------------------+-------------+
| id | category | publisher | bookTitle | author | publishDate |
+-----+----------+--------------- + ---------------------------------------------------------------------------+ -------------------------------------+-------------+ | 39 | C++ | SAMS | C++ Primer Plus Fourth Edition | Stephen Prata | 2001 | | 162 | Linux | Wiley | Ubuntu Linux Toolbox 1000 plus Commands for Ubuntu and Debian Power Users | Christopher Negus Fran�ois Caen | 2007 | | 496 | C++ | Prentice Hall | C Plus Plus GUI Programming With Qt 4 2nd Edition | Jasmin Blanchette, Mark Summerfield | 2008 | +-----+----------+--------------- + ---------------------------------------------------------------------------+ -------------------------------------+-------------+
3 rows in set (0.00 sec)

provides the correct answer?

Thinking that it the first query wasn't picking up a four letter term, I ran this search for the word 'real'

mysql> SELECT *
-> FROM booktitles
-> WHERE MATCH (category , publisher , bookTitle , author)
-> AGAINST (CONVERT( _utf8'real'USING latin1 )
-> IN BOOLEAN MODE)
-> ORDER BY category;
+-----+----------+--------------- +--------------------------------------------------------- +----------------------+-------------+
| id | category | publisher | bookTitle | author | publishDate |
+-----+----------+--------------- +--------------------------------------------------------- +----------------------+-------------+ | 134 | Linux | Prentice Hall | Embedded Linux Primer: A Practical, Real-World Approach | Christopher Hallinan | 2006 | +-----+----------+--------------- +--------------------------------------------------------- +----------------------+-------------+
1 row in set (0.00 sec)

and as you can see it came up with the correct result.

Thanks for looking

Barry

--
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]

Reply via email to