SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: mysql fulltext

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2005
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql fulltext

    Hi Please could someone tell me if my syntax is correct here.

    I want to make sure that if the word or phase that is search for is
    in lower case, just in case there is a difference in the case of the text between the DB and the user request

    $sql = "SELECT id, title,
    MATCH(title,lower(body))
    AGAINST ('$searchwords') AS score FROM mytable
    WHERE MATCH(title,lower(body))
    AGAINST ('$searchwords') ORDER BY score DESC";

  2. #2
    SitePoint Evangelist
    Join Date
    Mar 2005
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql fulltext

    Hi Everyone

    Is fulltext really the answer to create a website search or would it be better to use the google api instead to search your site.

    Thanks
    Niva

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by nivashni
    Hi Please could someone tell me if my syntax is correct here.
    yes, if you remove the LOWER() function

    mysql fulltext search is case-insensitive
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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