SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    What is FULTEXT for purpose of natural-language searching

    Hello,

    We want to do search of certain fields in our DB, these fields are VARCHAR.
    I see from MySQL that natural-language searching is possible with command like:

    SELECT * FROM submit_web_data WHERE MATCH (title, descpt) AGAINST ('hotels in Paris');

    But the MySQL gives error that: Can't find FULLTEXT index matching the column list

    Looking at MySQL manual I see this:

    mysql> CREATE TABLE articles (
    -> id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
    -> title VARCHAR(200),
    -> body TEXT,
    -> FULLTEXT (title,body)
    -> ) ENGINE=MyISAM;
    Query OK, 0 rows affected (0.00 sec)

    so are we supposed to create a new field in our Table called:

    FULLTEXT (title, descpt) ???

    If yes, how does one create this new field?
    And will this field data will then be auto filled from the moment it is added?

    ThanX.

    Anoox search engine volunteer

    www.anoox.com

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,251
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by WorldNews View Post
    If yes, how does one create this new field?
    just like that


    Quote Originally Posted by WorldNews View Post
    And will this field data will then be auto filled from the moment it is added?
    yes
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    What do you mean just like that?
    That is the Table in question currently does not have a FULLTEXT field.
    So how do we add a FULLTEXT field to it made up of fields: title, body ?

    ThanX

    Quote Originally Posted by r937 View Post
    just like that
    yes

    Anoox search engine volunteer

    www.anoox.com

  4. #4
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    Just wanted to let you know that I already got the answer to this question.
    Thanks.

    Quote Originally Posted by r937 View Post
    just like that
    yes

    Anoox search engine volunteer

    www.anoox.com


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
  •