Chris,

You're nearly there - the way to do it is:

SELECT first_name,last_name,MATCH(first_name,last_name) AGAINST
('+wilkinson* chris*' IN BOOLEAN MODE) AS score FROM names_table WHERE
MATCH(first_name,last_name) AGAINST ('+wilkinson* chris*' IN
BOOLEAN MODE) ORDER BY score DESC;

The db engine won't execute the full text query more than once so this is
not inefficient.

Andy

> -----Original Message-----
> From: Chris Wilkinson [mailto:[EMAIL PROTECTED]
> Sent: 03 June 2003 13:12
> To: [EMAIL PROTECTED]
> Subject: full text searching question
>
>
> can anybody explain this to me please!  I search am searching
> through a database
> with first name and last names.  BTW I use mysql 4.0.13 on RedHat
> Linux 9.0 in
> case that matters.  I created a fulltext search on both fields
> together so I can
> search them like this:
>
> mysql> SELECT first_name,last_name FROM names_table WHERE
> MATCH(first_name,last_name) AGAINST ('+wilkinson* chris*' IN
> BOOLEAN MODE);
>
> The problem is that for some reason the record with
> first_name=fran is displayed
> first even though the score is lower than the record where
> first_name=christopher
>
> mysql> SELECT first_name,last_name,MATCH(first_name,last_name) AGAINST
> ('+wilkinson* chris*' IN BOOLEAN MODE) AS score FROM names_table WHERE
> MATCH(first_name,last_name) AGAINST ('+wilkinson* chris*' IN
> BOOLEAN MODE);
> +-------------+-----------+-----------------+
> | first_name  | last_name | score           |
> +-------------+-----------+-----------------+
> | Fran        | Wilkinson |               1 |
> | Christopher | Wilkinson | 1.3333333730698 |
> +-------------+-----------+-----------------+
> 2 rows in set (0.01 sec)
>
> Can somebody please explain why this is and how I can get
> Christopher to show up
> before Fran!  Thanks!
>
> --
> Chris Wilkinson
> [EMAIL PROTECTED]
>
> --
> 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