List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 3 2003 6:23pm
Subject:Re: full text searching question
View as plain text  
At 13:11 +0100 6/3/03, Chris Wilkinson wrote:
>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!

Add ORDER BY score DESC to the query.

>--
>Chris Wilkinson
>wilkich@stripped

Thread
full text searching questionChris Wilkinson3 Jun
  • Re: full text searching questionkjc3 Jun
  • Re: full text searching questionPaul DuBois3 Jun
  • RE: full text searching questionAndy Eastham3 Jun
  • RE: full text searching questionAndy Eastham3 Jun