Errors with MySQL Full text searching

Discussion in 'MySQL' started by goldensea80, Sep 20, 2007.

  1. #1
    I am having terrible experiences with mySQL full text search. OK. I'll try to express the problem short! I have a table with two full text index: field1, field2. When I use full text search with each of them, it's OK:
    Case1: I insert the full text indexes like this:
    
    ALTER TABLE my_table ADD FULLTEXT (field1,field2);
    
    Code (markup):
    Then This query does not works!
    
    SELECT * FROM my_table WHERE MATCH(field1) AGAINST ('some keywords')
    
    #1191 - Can't find FULLTEXT index matching the column list 
    
    Code (markup):
    Case2: I insert the Full text indexes as 2 separated queries
    
    ALTER TABLE my_table ADD FULLTEXT (field1);
    ALTER TABLE my_table ADD FULLTEXT (field2);
    
    Code (markup):
    THen, the full text search with ONE field works, but with TWO fields does work!

    
    SELECT * FROM my_table WHERE MATCH(field1) AGAINST ('some keywords')
    --->OK!
    SELECT * FROM my_table WHERE MATCH(field1,field2) AGAINST ('some keywords')
    --->NOT OK! #1191 - Can't find FULLTEXT index matching the column list 
    
    
    Code (markup):
    Can somebody explain the situation? I am using mySQL version 4.1
     
    goldensea80, Sep 20, 2007 IP
  2. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you are not using my_isam it might be because of that. AFAIK, only my_isam type table can generate fulltext index. CMIIW
     
    kendo1979, Sep 20, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    The FULLTEXT index has to be for both the fields together, not both of them individually.

    E.g. in phpMyAdmin, in the table structure view, select 2 fields and then select the FULLTEXT index in the "With Selected" list.
     
    krt, Sep 20, 2007 IP
    goldensea80 and sawz like this.
  4. goldensea80

    goldensea80 Well-Known Member

    Messages:
    422
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    128
    #4
    To kendo1979: Thanks, but that's not the problem. I am using MyIsam.

    To krt: Yep! That's right. Thanks, I've solved it!
     
    goldensea80, Sep 21, 2007 IP