MySQL: how to make multiple table fulltext search

后端 未结 2 694
春和景丽
春和景丽 2020-12-11 09:39

I want to integrate the MySQL fulltext search function in my PHP site.

I have the following problem now.

SELECT *
FROM testtable t1, testtable2 t2
WH         


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 10:14

    I think since full text search use some specific indexes you should separate table by OR

    SELECT *
    FROM testtable t1, testtable2 t2
    WHERE MATCH (
    t1.firstName, t1.lastName, t1.details
    )
    AGAINST (
    'founder'
    ) OR MATCH( t2.firstName, t2.lastName, t2.details) AGAINST (
    'founder'
    ); 
    

提交回复
热议问题