Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Question Unanswered: How to sort the search result order by most relevancy?

    Dear friends.
    I wanna know how can I optimize my search results?
    Exactly when I try to use FULLTEXT search for more than one word, the result can be returned by any record that includes at least one of those words. I want to get the result ordered by most related records.
    Is there any way in MySQL?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    just repeat the MATCH expression in the ORDER BY clause
    Code:
    SELECT ...
      FROM ...
     WHERE MATCH ( ... ) AGAINST ( ... )
    ORDER
        BY MATCH ( ... ) AGAINST ( ... ) DESC
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    Many Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •